diff options
Diffstat (limited to 'quantum/template')
-rw-r--r-- | quantum/template/Makefile | 23 | ||||
-rw-r--r-- | quantum/template/config.h | 47 | ||||
-rw-r--r-- | quantum/template/template.c | 49 | ||||
-rw-r--r-- | quantum/template/template.h | 12 |
4 files changed, 99 insertions, 32 deletions
diff --git a/quantum/template/Makefile b/quantum/template/Makefile index 2efa69138..4fa195468 100644 --- a/quantum/template/Makefile +++ b/quantum/template/Makefile @@ -113,18 +113,19 @@ OPT_DEFS += -DBOOTLOADER_SIZE=512 # 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 +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 +KEYBOARD_LOCK_ENABLE = yes # Allow locking of keyboard via magic key # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -# SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend -# NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -# BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -# MIDI_ENABLE = YES # MIDI controls -# UNICODE_ENABLE = YES # Unicode -# BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID +# SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +#NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +# BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +# MIDI_ENABLE = YES # MIDI controls +# UNICODE_ENABLE = YES # Unicode +# BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID # Optimize size but this may cause error "relocation truncated to fit" diff --git a/quantum/template/config.h b/quantum/template/config.h index 7d6149f43..dae4b6313 100644 --- a/quantum/template/config.h +++ b/quantum/template/config.h @@ -55,11 +55,56 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* key combination for command */ +/* Force NKRO Mode - If forced on, must be disabled via magic key (default = LShift+RShift+N) */ +//#define FORCE_NKRO + +/* + * Magic key options + * These options allow the magic key functionality to be changed. This is useful + * if your keyboard/keypad is missing keys and you want magic key support. + */ + +/* key combination for magic key command */ #define IS_COMMAND() ( \ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/quantum/template/template.c b/quantum/template/template.c index 7be7dfc3d..cc52e496f 100644 --- a/quantum/template/template.c +++ b/quantum/template/template.c @@ -1,29 +1,48 @@ #include "%KEYBOARD%.h" __attribute__ ((weak)) -void * matrix_init_user(void) { - // leave these blank +void matrix_init_user(void) { + // leave this function blank - it can be defined in a keymap file }; __attribute__ ((weak)) -void * matrix_scan_user(void) { - // leave these blank -}; +void matrix_scan_user(void) { + // leave this function blank - it can be defined in a keymap file +} + +__attribute__ ((weak)) +void process_action_user(keyrecord_t *record) { + // leave this function blank - it can be defined in a keymap file +} + +__attribute__ ((weak)) +void led_set_user(uint8_t usb_led) { + // leave this function blank - it can be defined in a keymap file +} -void * matrix_init_kb(void) { +void matrix_init_kb(void) { // put your keyboard start-up code here // runs once when the firmware starts up - if (matrix_init_user) { - (*matrix_init_user)(); - } -}; + matrix_init_user(); +} -void * matrix_scan_kb(void) { +void matrix_scan_kb(void) { // put your looping keyboard code here // runs every cycle (a lot) - if (matrix_scan_user) { - (*matrix_scan_user)(); - } -};
\ No newline at end of file + matrix_scan_user(); +} + +void process_action_kb(keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + process_action_user(record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/quantum/template/template.h b/quantum/template/template.h index d4d78e4c9..b1c34d3cb 100644 --- a/quantum/template/template.h +++ b/quantum/template/template.h @@ -12,14 +12,16 @@ // The second converts the arguments into a two-dimensional array #define KEYMAP( \ k00, k01, k02, \ - k10, k11, \ + k10, k11 \ ) \ { \ { k00, k01, k02 }, \ { k10, KC_NO, k11 }, \ -} +} -void * matrix_init_user(void); -void * matrix_scan_user(void); +void matrix_init_user(void); +void matrix_scan_user(void); +void process_action_user(keyrecord_t *record); +void led_set_user(uint8_t usb_led); -#endif
\ No newline at end of file +#endif |