X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;f=keyboard%2Fonekey%2Fkeymap.c;h=2a43563471802e2145a28d7782cc361abef64724;hb=d96f295106d5f2360fed9c912226377d3b7684c0;hp=11804bf34cd8d7c2d4942de79ebc67ff8b7a046e;hpb=c04b6bec89dd570efe3a7da68ac8deba7abff6d8;p=max%2Ftmk_keyboard.git diff --git a/keyboard/onekey/keymap.c b/keyboard/onekey/keymap.c index 11804bf3..2a435634 100644 --- a/keyboard/onekey/keymap.c +++ b/keyboard/onekey/keymap.c @@ -16,7 +16,6 @@ along with this program. If not, see . */ #include #include -#include #include "keycode.h" #include "action.h" #include "action_macro.h" @@ -36,31 +35,3 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ static const action_t PROGMEM fn_actions[] = { }; - - - -#define KEYMAPS_SIZE (sizeof(keymaps) / sizeof(keymaps[0])) -#define FN_ACTIONS_SIZE (sizeof(fn_actions) / sizeof(fn_actions[0])) - -/* translates key to keycode */ -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)]); - } else { - // fall back to layer 0 - return pgm_read_byte(&keymaps[0][(key.row)][(key.col)]); - } -} - -/* translates Fn keycode to action */ -action_t keymap_fn_to_action(uint8_t keycode) -{ - action_t action; - if (FN_INDEX(keycode) < FN_ACTIONS_SIZE) { - action.code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]); - } else { - action = (action_t)ACTION_NO; - } - return action; -}