diff options
author | Jack Humbert <jack.humb@gmail.com> | 2015-03-20 22:49:32 -0400 |
---|---|---|
committer | Jack Humbert <jack.humb@gmail.com> | 2015-03-20 22:49:32 -0400 |
commit | 5c45ba947c760cbb28e67d6eabb887fb56cdb170 (patch) | |
tree | aaa96543fa1b2e2364ba1b7205ed251ec3f7d08a /keyboard/planck/extended_keymap_common.c | |
parent | a94beded1a36057a2afc3d321b4c3f7dd6afa251 (diff) |
function stuff too
Diffstat (limited to 'keyboard/planck/extended_keymap_common.c')
-rw-r--r-- | keyboard/planck/extended_keymap_common.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/keyboard/planck/extended_keymap_common.c b/keyboard/planck/extended_keymap_common.c index 895c7418be..387ad43d35 100644 --- a/keyboard/planck/extended_keymap_common.c +++ b/keyboard/planck/extended_keymap_common.c @@ -33,10 +33,12 @@ action_t action_for_key(uint8_t layer, keypos_t key) uint16_t keycode = keymap_key_to_keycode(layer, key); // Handle mods in keymap - if (keycode > 0x00FF) { + if (keycode > 0x00FF && keycode < 0x2000) { action_t action; action.code = ACTION_MODS_KEY(keycode >> 8, keycode & 0xFF); return action; + } else if (keycode > 0x1FFF && keycode < 0x3000) { + return keymap_func_to_action(keycode & 0xFFF); } switch (keycode) { @@ -169,3 +171,9 @@ action_t keymap_fn_to_action(uint16_t keycode) { return (action_t){ .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) }; } + +/* translates Fn keycode to action */ +action_t keymap_func_to_action(uint16_t keycode) +{ + return (action_t){ .code = pgm_read_word(&fn_actions[(int)keycode]) }; +}
\ No newline at end of file |