X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;f=keyboard%2Fonekey%2Fkeymap.c;h=dca32d27f398cc82bf47c7374e5f1a18c540c1f9;hb=ab083c7ecff4f8a576d858745ab353f7937a1b94;hp=11804bf34cd8d7c2d4942de79ebc67ff8b7a046e;hpb=c04b6bec89dd570efe3a7da68ac8deba7abff6d8;p=max%2Ftmk_keyboard.git diff --git a/keyboard/onekey/keymap.c b/keyboard/onekey/keymap.c index 11804bf3..dca32d27 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" @@ -27,40 +26,12 @@ along with this program. If not, see . #include "keymap.h" -static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {{KC_A}}, }; /* * Fn action definition */ -static const action_t PROGMEM fn_actions[] = { +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; -}