6 # include <avr/pgmspace.h>
10 /* Keymapping with 16bit action codes */
11 extern const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS];
13 // table translates matrix to universal keymap
14 extern const uint8_t unimap_trans[MATRIX_ROWS][MATRIX_COLS];
18 // translates raw matrix to universal map
19 keypos_t unimap_translate(keypos_t key)
23 pgm_read_byte(&unimap_trans[key.row][key.col]);
25 unimap_trans[key.row][key.col];
28 .row = ((unimap_pos & 0x70) >> 4),
29 .col = (unimap_pos & 0x0F)
33 /* Converts key to action */
34 __attribute__ ((weak))
35 action_t action_for_key(uint8_t layer, keypos_t key)
37 keypos_t uni = unimap_translate(key);
38 if ((uni.row << 4 | uni.col) == UNIMAP_NO) return (action_t)ACTION_NO;
40 return (action_t)pgm_read_word(&actionmaps[(layer)][(uni.row)][(uni.col)]);
42 return actionmaps[(layer)][(uni.row)][(uni.col)];
47 __attribute__ ((weak))
48 const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
54 __attribute__ ((weak))
55 void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)