diff options
author | tmk <nobody@nowhere> | 2010-09-16 21:05:15 +0900 |
---|---|---|
committer | tmk <nobody@nowhere> | 2010-09-16 21:05:15 +0900 |
commit | f777960c7255b469f3daaec89b9808844f13bb88 (patch) | |
tree | f25da595aa030b9556d5a5106ac34f68bb9cadc3 /mykey.c | |
parent | 82309deefc21f66d92df08b8eecae8466939e04d (diff) |
simple keymap layers.
Diffstat (limited to 'mykey.c')
-rw-r--r-- | mykey.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -78,9 +78,11 @@ int main(void) print("keyboard firmware 0.1 for t.m.k.\n"); while (1) { + int layer = 0; uint8_t row, col, code; matrix_scan(); + layer = get_layer(); modified = matrix_is_modified(); has_ghost = matrix_has_ghost(); @@ -95,8 +97,10 @@ int main(void) for (col = 0; col < MATRIX_COLS; col++) { if (matrix[row] & 1<<col) continue; - code = get_keycode(row, col); - if (KB_LCTRL <= code && code <= KB_RGUI) { + code = get_keycode(layer, row, col); + if (code == KB_NO) { + continue; + } else if (KB_LCTRL <= code && code <= KB_RGUI) { // modifier keycode: 0xE0-0xE7 keyboard_modifier_keys |= 1<<(code & 0x07); } else { |