summaryrefslogtreecommitdiff
path: root/mykey.c
diff options
context:
space:
mode:
authortmk <nobody@nowhere>2010-09-16 21:05:15 +0900
committertmk <nobody@nowhere>2010-09-16 21:05:15 +0900
commitf777960c7255b469f3daaec89b9808844f13bb88 (patch)
treef25da595aa030b9556d5a5106ac34f68bb9cadc3 /mykey.c
parent82309deefc21f66d92df08b8eecae8466939e04d (diff)
simple keymap layers.
Diffstat (limited to 'mykey.c')
-rw-r--r--mykey.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/mykey.c b/mykey.c
index b22c68fb84..ba323448be 100644
--- a/mykey.c
+++ b/mykey.c
@@ -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 {