1
0
Fork 0

function stuff too

This commit is contained in:
Jack Humbert 2015-03-20 22:49:32 -04:00
parent a94beded1a
commit 5c45ba947c
3 changed files with 18 additions and 4 deletions

View file

@ -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]) };
}