X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;f=keyboard%2Fergodox%2Fkeymap.c;h=39713e5026ae4a1fb9d745a9ae02901f71ab85bc;hb=6edd0fff3727525fe6d61d9d6d605d1759a3e1c3;hp=a827f36a1d22a3759d8b96fcfa446eba4e66386c;hpb=06dbf890437887da583617530223fc7a63c40786;p=max%2Ftmk_keyboard.git diff --git a/keyboard/ergodox/keymap.c b/keyboard/ergodox/keymap.c index a827f36a..39713e50 100644 --- a/keyboard/ergodox/keymap.c +++ b/keyboard/ergodox/keymap.c @@ -20,8 +20,10 @@ along with this program. If not, see . #include #include "keycode.h" #include "action.h" +#include "action_util.h" #include "action_code.h" #include "action_macro.h" +#include "action_layer.h" #include "bootloader.h" #include "report.h" #include "host.h" @@ -160,7 +162,7 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TRNS, TRNS,TRNS,TRNS, // right hand - SLCK,NLCK,PSLS,PAST,PAST,PMNS,BSPC, + TRNS,NLCK,PSLS,PAST,PAST,PMNS,BSPC, TRNS,NO, P7, P8, P9, PMNS,BSPC, NO, P4, P5, P6, PPLS,PENT, TRNS,NO, P1, P2, P3, PPLS,PENT, @@ -183,9 +185,9 @@ enum function_id { static const uint16_t PROGMEM fn_actions[] = { ACTION_FUNCTION(TEENSY_KEY), // FN0 - Teensy key ACTION_LAYER_MOMENTARY(1), // FN1 - switch to Layer1 - ACTION_LAYER_SET(2, ON_PRESS), // FN2 - push Layer2 - ACTION_LAYER_SET(3, ON_PRESS), // FN3 - push Layer3 - ACTION_LAYER_SET(0, ON_PRESS), // FN4 - push Layer0 + ACTION_LAYER_SET(2, ON_PRESS), // FN2 - set Layer2 + ACTION_LAYER_TOGGLE(3), // FN3 - toggle Layer3 aka Numpad layer + ACTION_LAYER_SET(0, ON_PRESS), // FN4 - set Layer0 }; void action_function(keyrecord_t *event, uint8_t id, uint8_t opt) @@ -206,7 +208,7 @@ void action_function(keyrecord_t *event, uint8_t id, uint8_t opt) #define FN_ACTIONS_SIZE (sizeof(fn_actions) / sizeof(fn_actions[0])) /* translates key to keycode */ -uint8_t keymap_key_to_keycode(uint8_t layer, key_t key) +uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key) { if (layer < KEYMAPS_SIZE) { return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]); @@ -216,6 +218,11 @@ uint8_t keymap_key_to_keycode(uint8_t layer, key_t key) } } +#if defined(KEYMAP_CUB) + +// function keymap_fn_to_action will be defined in keymap_cub.h + +#else /* translates Fn keycode to action */ action_t keymap_fn_to_action(uint8_t keycode) { @@ -227,4 +234,5 @@ action_t keymap_fn_to_action(uint8_t keycode) } return action; } +#endif