diff options
author | tmk <nobody@nowhere> | 2010-08-23 15:46:24 +0900 |
---|---|---|
committer | tmk <nobody@nowhere> | 2010-08-23 23:11:14 +0900 |
commit | 3b31337cd8a5fe8b02924f2056ad2648a028c563 (patch) | |
tree | 060cc2413f74f89c957655d3fe954ac58c3ae42d /keymap.c | |
parent | c17f07819ffeb119a09d4acdfa5097b272d2e2f9 (diff) |
perform nomal keyboard behavior. It works now!!!
Diffstat (limited to 'keymap.c')
-rw-r--r-- | keymap.c | 27 |
1 files changed, 13 insertions, 14 deletions
@@ -1,28 +1,27 @@ /* - * keymap for modified macway keyboard + * keymap for modified macway keyboarq */ #include <avr/pgmspace.h> #include "keymap.h" -#define MATRIX_ROWS 9 -#define MATRIX_COLS 8 - -static const uint8_t PROGMEM Keymap[MATRIX_COLS][MATRIX_ROWS] = { - { KB_LALT, KB_1, KB_2, KB_3, KB_4, KB_7, KB_8, KB_9, KB_0 }, - { KB_NO, KB_ESCAPE, KB_RALT, KB_NO, KB_5, KB_6, KB_EQUAL, KB_NO, KB_MINUS }, - { KB_BSPACE, KB_TAB, KB_LGUI, KB_RSHIFT, KB_T, KB_Y, KB_RBRACKET, KB_NO, KB_LBRACKET }, - { KB_NO, KB_Q, KB_W, KB_E, KB_R, KB_U, KB_I, KB_O, KB_P }, - { KB_BSLASH, KB_A, KB_S, KB_D, KB_F, KB_J, KB_K, KB_L, KB_SCOLON }, - { KB_NO, KB_LCTRL, KB_NO, KB_UP, KB_G, KB_H, KB_NO, KB_GRAVE, KB_QUOTE }, - { KB_ENTER, KB_Z, KB_X, KB_C, KB_V, KB_M, KB_COMMA, KB_DOWN, KB_NO }, - { KB_SPACE, KB_DOWN, KB_RIGHT, KB_LEFT, KB_B, KB_N, KB_LSHIFT, KB_NO, KB_SLASH } +static const uint8_t PROGMEM Keymap[MATRIX_ROWS][MATRIX_COLS] = { + { KB_LALT, KB_NO, KB_BSPACE, KB_NO, KB_LEFT, KB_NO, KB_ENTER, KB_SPACE }, + { KB_1, KB_ESCAPE, KB_TAB, KB_Q, KB_A, KB_LCTRL, KB_Z, KB_RIGHT }, + { KB_2, KB_RALT, KB_LGUI, KB_W, KB_S, KB_NO, KB_X, KB_UP }, + { KB_3, KB_NO, KB_RSHIFT, KB_E, KB_D, KB_BSLASH, KB_C, KB_DOWN }, + { KB_4, KB_5, KB_T, KB_R, KB_F, KB_G, KB_V, KB_B }, + { KB_7, KB_6, KB_Y, KB_U, KB_J, KB_H, KB_M, KB_N }, + { KB_8, KB_EQUAL, KB_RBRACKET, KB_I, KB_K, KB_NO, KB_COMMA, KB_LSHIFT }, + { KB_9, KB_NO, KB_NO, KB_O, KB_L, KB_GRAVE, KB_DOT, KB_NO }, + { KB_0, KB_MINUS, KB_LBRACKET, KB_P, KB_SCOLON, KB_QUOTE, KB_NO, KB_SLASH } }; + uint8_t get_keycode(uint8_t row, uint8_t col) { if (row >= MATRIX_ROWS) return KB_NO; if (col >= MATRIX_COLS) return KB_NO; - return pgm_read_byte(&Keymap[col][row]); + return pgm_read_byte(&Keymap[row][col]); } |