Hi!
thanks for the help. My keyboard has been great. however tonight I tried to make the keyboards function buttons as the power key, even following what was said it still doesn't work.
I changed the magic command in config.h :
/*
Copyright 2011 Jun Wako <wakojun@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CONFIG_H
#define CONFIG_H
#define VENDOR_ID 0xFEED
#define PRODUCT_ID 0x0ADB
#define DEVICE_VER 0x0101
#define MANUFACTURER t.m.k.
#define PRODUCT Apple
#define DESCRIPTION M0116 Apple Keyboard
/* matrix size */
#define MATRIX_ROWS 16 // keycode bit: 3-0
#define MATRIX_COLS 8 // keycode bit: 6-4
#define MATRIX_ROW(code) ((code)>>3&0x0F)
#define MATRIX_COL(code) ((code)&0x07)
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */
#define LOCKING_RESYNC_ENABLE
/* legacy keymap support */
#define USE_LEGACY_KEYMAP
/* ADB port setting */
#define ADB_PORT PORTD
#define ADB_PIN PIND
#define ADB_DDR DDRD
#define ADB_DATA_BIT 0
//#define ADB_PSW_BIT 1 // optional
/* key combination for command */
#ifndef __ASSEMBLER__
#include "adb.h"
#include "matrix.h"
/*#define IS_COMMAND() ( \
matrix_is_on(MATRIX_ROW(ADB_POWER), MATRIX_COL(ADB_POWER)) \
)
*/
/* key combination for command */
#define IS_COMMAND() ( \
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
)
/*#define IS_COMMAND() ( \
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_LALT) | MOD_BIT(KC_LGUI)) \
)
*/
#endif
#endif
and I disabled it as well in makefile
#----------------------------------------------------------------------------
# On command line:
#
# make all = Make software.
#
# make clean = Clean out built project files.
#
# make coff = Convert ELF to AVR COFF.
#
# make extcoff = Convert ELF to AVR Extended COFF.
#
# make program = Download the hex file to the device.
# Please customize your programmer settings(PROGRAM_CMD)
#
# make teensy = Download the hex file to the device, using teensy_loader_cli.
# (must have teensy_loader_cli installed).
#
# make dfu = Download the hex file to the device, using dfu-programmer (must
# have dfu-programmer installed).
#
# make flip = Download the hex file to the device, using Atmel FLIP (must
# have Atmel FLIP installed).
#
# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
# (must have dfu-programmer installed).
#
# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
# (must have Atmel FLIP installed).
#
# make debug = Start either simulavr or avarice as specified for debugging,
# with avr-gdb or avr-insight as the front end for debugging.
#
# make filename.s = Just compile filename.c into the assembler code only.
#
# make filename.i = Create a preprocessed source file for use in submitting
# bug reports to the GCC project.
#
# To rebuild project do "make clean" then "make all".
#----------------------------------------------------------------------------
# Target file name (without extension).
TARGET = adb_usb_lufa
# Directory common source filess exist
TMK_DIR = ../../tmk_core
# Directory keyboard dependent files exist
TARGET_DIR = .
# project specific files
SRC = keymap_common.c \
matrix.c \
led.c \
adb.c
ifdef KEYMAP
SRC := keymap_$(KEYMAP).c $(SRC)
else
SRC := keymap_ansi.c $(SRC)
endif
CONFIG_H = config.h
# MCU name
#MCU = at90usb1287
MCU = atmega32u4
# Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code.
#
# This will be an integer division of F_USB below, as it is sourced by
# F_USB after it has run through any CPU prescalers. Note that this value
# does not *change* the processor frequency - it should merely be updated to
# reflect the processor speed set externally so that the code can use accurate
# software delays.
F_CPU = 16000000
#
# LUFA specific
#
# Target architecture (see library "Board Types" documentation).
ARCH = AVR8
# Input clock frequency.
# This will define a symbol, F_USB, in all source code files equal to the
# input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
# at the end, this will be done automatically to create a 32-bit value in your
# source code.
#
# If no clock division is performed on the input clock inside the AVR (via the
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
F_USB = $(F_CPU)
# Interrupt driven control endpoint task(+60)
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
# Boot Section Size in *bytes*
# Teensy halfKay 512
# Teensy++ halfKay 1024
# Atmel DFU loader 4096
# LUFA bootloader 4096
# USBaspLoader 2048
OPT_DEFS += -DBOOTLOADER_SIZE=4096
# Build Options
# comment out to disable the options.
#
#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
#MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = yes # Console for debug(+400)
#COMMAND_ENABLE = yes # Commands for debug and configuration
#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
NKRO_ENABLE = yes # USB Nkey Rollover
#ADB_MOUSE_ENABLE = yes
# ADB Mice need acceleration for todays much bigger screens.
OPT_DEFS += -DADB_MOUSE_MAXACC=8
# Optimize size but this may cause error "relocation truncated to fit"
#EXTRALDFLAGS = -Wl,--relax
# Search Path
VPATH += $(TARGET_DIR)
VPATH += $(TMK_DIR)
include $(TMK_DIR)/protocol/lufa.mk
include $(TMK_DIR)/protocol.mk
include $(TMK_DIR)/common.mk
include $(TMK_DIR)/rules.mk
and obviously changed the keymap from the caps key to the power key.
#include "keymap_common.h"
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Default layer : plain keymap IGNORE THE DIAGRAMS, THEY ARE NOT INDICATIVE OF THE KEYBOARD
* +-------+
* | FN1 |
* +-------+
* +---+---+---+---+---+---+---+---+---+---+---+---+---+-----+ +---+---+---+---+
* |esc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | bks | |clr| = | / | * |
* +---------------------------------------------------------+ +---+---+---+---+
* | tab | q | w | e | r | t | y | u | i | o | p | [ | ] | | | 7 | 8 | 9 | + |
* +-----------------------------------------------------+ | +---+---+---+---+
* | caps | a | s | d | f | g | h | j | k | l | ; | ' |return| | 4 | 5 | 6 | - |
* +---------------------------------------------------------+ +---+---+---+---+
* | shift | z | x | c | v | b | n | m | , | . | / | shift | | 1 | 2 | 3 | |
* +---------------------------------------------------------+ +-------+---|ent|
* |Ctrl|opt|comnd| ` | | \ |lef|rig|dwn|up | | 0 | . | |
* +---------------------------------------------------------+ +-------+---+---+
*FROM WHAT I UNDERSTAND FN2 (WHICH IS CURRENTLY SET AS PERIOD ON THE NUMBERPAD) ACTIVATES THE COMMAND I HAVE LABLED AT THE BOTTOM
*/
[0] = KEYMAP_M0116_ANSI(
FN2,
ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, DEL, EQL, PSLS,NLCK,
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, P7, P8, P9, PPLS,
LCTL, A, S, D, F, G, H, J, K, L, SCLN, QUOT, ENT, P4, P5, P6, PMNS,
LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT, P1, P2, P3,
CAPS,LGUI,LALT,GRV, SPC, BSLS,LEFT,RGHT,DOWN,UP, P0, FN1,PENT
),
/* Layer 1 :
* +-------+
* | FN1 |
* +-------+
* +---+---+---+---+---+---+---+---+---+---+---+---+---+-----+ +---+---+---+---+
* |Esc|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12| | | | | |Mut|
* +---------------------------------------------------------+ +---+---+---+---+
* | | | | | | | | | | | | | | | | | | |VoU|
* +-----------------------------------------------------+ | +---+---+---+---+
* | | | | | | | | | | | | | | | | | |VoD|
* +---------------------------------------------------------+ +---+---+---+---+
* | | | | | | | | | | | |Capslock| | | | | |
* +---------------------------------------------------------+ +-------+---| |
* |Fn1| | | | | |Hom|End|PgD|PgU| | | | |
* +---------------------------------------------------------+ +-------+---+---+
*THIS LAYER IS MEANT TO ACTIVATE WHEN I HIT FN2
*/
[1] = KEYMAP_M0116_ANSI(
TRNS,
ESC, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,TRNS,TRNS, TRNS, DEL, HOME, PGUP, MUTE,
TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, INS, END,PGDN, VOLU,
TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, UP, TRNS, VOLD,
TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, LEFT,DOWN,RGHT,
TRNS,TRNS , TRNS, TRNS, TRNS, TRNS, TRNS,TRNS,TRNS,TRNS, TRNS, FN1, TRNS
),
/* Layer 2 :
* +-------+
* | FN1 |
* +-------+
* +---+---+---+---+---+---+---+---+---+---+---+---+---+-----+ +---+---+---+---+
* |Esc|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12| | | | | |Mut|
* +---------------------------------------------------------+ +---+---+---+---+
* | | | | | | | | | | | | | | | | | | |VoU|
* +-----------------------------------------------------+ | +---+---+---+---+
* | | | | | | | | | | | | | | | | | |VoD|
* +---------------------------------------------------------+ +---+---+---+---+
* | | | | | | | | | | | |Capslock| | | | | |
* +---------------------------------------------------------+ +-------+---| |
* |Fn1| | | | | |Hom|End|PgD|PgU| | | | |
* +---------------------------------------------------------+ +-------+---+---+
*/
[2] = KEYMAP_M0116_ANSI(
TRNS,
ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10,F11,F12, TRNS, TRNS, TRNS, TRNS, TRNS,
TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,
TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,
TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,TRNS, TRNS,
TRNS,TRNS , TRNS, TRNS, TRNS, TRNS, TRNS,TRNS,TRNS,TRNS, TRNS, TRNS, TRNS
),
};
const uint16_t PROGMEM fn_actions[] = {
[1] = ACTION_LAYER_TOGGLE(1), /*THIS IS MEANT TO ACTIVATE THE LAYER THAT IS LABELED LAYER 1*/
[2] = ACTION_LAYER_TAP_KEY(2,1),
};
/*
const uint16_t PROGMEM fn_actions[] = {
ACTION_LAYER_TOGGLE(1), THIS LAYER IS MEANT TO ACTIVATE WHEN I PRESS FN2, WHICH GOES TO LAYER 1 WHICH IS THE SECOND LAYER BECAUSE COMPUTERS COUNT FROM 0
ACTION_LAYER_TAP_KEY(2, KC_CAPS),
};
copied from tufty's keymap
*/
any Ideas? thanks.