aboutsummaryrefslogtreecommitdiff
path: root/hhkb
diff options
context:
space:
mode:
authortmk <nobody@nowhere>2010-10-28 15:43:51 +0900
committertmk <nobody@nowhere>2010-10-28 15:43:51 +0900
commit6c3b9a2ded1afcf4a6bbc69878f52088f4c1a0e8 (patch)
tree54fa3d4def2748cc19faff5f9d6b393d75a556ac /hhkb
parent46545c038034845658e40f1637b5a4465a9aefda (diff)
downloadqmk_firmware-6c3b9a2ded1afcf4a6bbc69878f52088f4c1a0e8.tar.gz
qmk_firmware-6c3b9a2ded1afcf4a6bbc69878f52088f4c1a0e8.zip
ADD: macway/doc
FIX: keymap
Diffstat (limited to 'hhkb')
-rw-r--r--hhkb/doc/HHKB.txt8
-rw-r--r--hhkb/keymap.c20
2 files changed, 16 insertions, 12 deletions
diff --git a/hhkb/doc/HHKB.txt b/hhkb/doc/HHKB.txt
index bdd297dcd..3ca272c80 100644
--- a/hhkb/doc/HHKB.txt
+++ b/hhkb/doc/HHKB.txt
@@ -8,7 +8,7 @@ Teensy++ has clean pinout and it makes programing and wiring easier.
8This is just a proof of concept for replacing controller of HHKB, not a complete firmware. 8This is just a proof of concept for replacing controller of HHKB, not a complete firmware.
9 9
10My prototype firmware source tree is here: 10My prototype firmware source tree is here:
11 branch: hhkb(http://github.com/tmk/tmk_keyboard/tree/hhkb) 11 github(http://github.com/tmk/tmk_keyboard)
12This firmware is a port of my previous project: 12This firmware is a port of my previous project:
13 HHKB style Mod(http://geekhack.org/showwiki.php?title=Island:11930) 13 HHKB style Mod(http://geekhack.org/showwiki.php?title=Island:11930)
14PJRC: 14PJRC:
@@ -173,13 +173,17 @@ Matrix scan pseudo code:
173 } else { 173 } else {
174 // not pressed 174 // not pressed
175 } 175 }
176
177 UNALBLE_COL(); // set LS145(D) to high
178
179 _delay_us(150);
176 } 180 }
177 } 181 }
178 182
179 183
180Keymap layers 184Keymap layers
181------------- 185-------------
182Followings are added layers with additional Fn keys. They are not final decision. 186Followings are added layers with additional Fn keys.
183 187
184see keymap.c 188see keymap.c
185 189
diff --git a/hhkb/keymap.c b/hhkb/keymap.c
index ca78200c0..2b887d9c7 100644
--- a/hhkb/keymap.c
+++ b/hhkb/keymap.c
@@ -40,7 +40,7 @@ static bool layer_used = false;
40 40
41 41
42/* layer to change into while Fn key pressed */ 42/* layer to change into while Fn key pressed */
43static const int PROGMEM fn_layer[] = { 0, 1, 2, 3, 4, 0, 0, 0 }; 43static const int PROGMEM fn_layer[] = { 0, 1, 2, 3, 4, 0, 0, 1 };
44 44
45/* keycode to sent when Fn key released without using layer keys. */ 45/* keycode to sent when Fn key released without using layer keys. */
46static const uint8_t PROGMEM fn_keycode[] = { 46static const uint8_t PROGMEM fn_keycode[] = {
@@ -51,7 +51,7 @@ static const uint8_t PROGMEM fn_keycode[] = {
51 KB_SPACE, // FN_4 layer 4 [NOT USED] 51 KB_SPACE, // FN_4 layer 4 [NOT USED]
52 KB_NO, // FN_5 [NOT USED] 52 KB_NO, // FN_5 [NOT USED]
53 KB_NO, // FN_6 [NOT USED] 53 KB_NO, // FN_6 [NOT USED]
54 KB_NO // FN_7 [NOT USED] 54 KB_NO // FN_7 layer 1
55}; 55};
56 56
57static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 57static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
@@ -65,14 +65,14 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
65 * |-----------------------------------------------------------| 65 * |-----------------------------------------------------------|
66 * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Fn1| 66 * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Fn1|
67 * `-----------------------------------------------------------' 67 * `-----------------------------------------------------------'
68 * |Gui|Alt |Space |Alt |Gui| 68 * |Gui|Alt |Space |Alt |Fn7|
69 * `-------------------------------------------' 69 * `-------------------------------------------'
70 */ 70 */
71 KEYMAP(KB_ESC, KB_1, KB_2, KB_3, KB_4, KB_5, KB_6, KB_7, KB_8, KB_9, KB_0, KB_MINS,KB_EQL, KB_BSLS,KB_GRV, \ 71 KEYMAP(KB_ESC, KB_1, KB_2, KB_3, KB_4, KB_5, KB_6, KB_7, KB_8, KB_9, KB_0, KB_MINS,KB_EQL, KB_BSLS,KB_GRV, \
72 KB_TAB, KB_Q, KB_W, KB_E, KB_R, KB_T, KB_Y, KB_U, KB_I, KB_O, KB_P, KB_LBRC,KB_RBRC,KB_BSPC, \ 72 KB_TAB, KB_Q, KB_W, KB_E, KB_R, KB_T, KB_Y, KB_U, KB_I, KB_O, KB_P, KB_LBRC,KB_RBRC,KB_BSPC, \
73 KB_LCTL,KB_A, KB_S, KB_D, KB_F, KB_G, KB_H, KB_J, KB_K, KB_L, FN_3, FN_2, KB_ENT, \ 73 KB_LCTL,KB_A, KB_S, KB_D, KB_F, KB_G, KB_H, KB_J, KB_K, KB_L, FN_3, FN_2, KB_ENT, \
74 KB_LSFT,KB_Z, KB_X, KB_C, KB_V, KB_B, KB_N, KB_M, KB_COMM,KB_DOT, KB_SLSH,KB_RSFT,FN_1, \ 74 KB_LSFT,KB_Z, KB_X, KB_C, KB_V, KB_B, KB_N, KB_M, KB_COMM,KB_DOT, KB_SLSH,KB_RSFT,FN_1, \
75 KB_LGUI,KB_LALT,KB_SPC, KB_RALT,KB_RGUI), 75 KB_LGUI,KB_LALT,KB_SPC, KB_RALT,FN_7),
76 76
77 /* Layer 1: HHKB mode (HHKB Fn) 77 /* Layer 1: HHKB mode (HHKB Fn)
78 * ,-----------------------------------------------------------. 78 * ,-----------------------------------------------------------.
@@ -84,14 +84,14 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
84 * |-----------------------------------------------------------| 84 * |-----------------------------------------------------------|
85 * |Shift | | | | | | +| -|End|PgD|Dow|Shift |xxx| 85 * |Shift | | | | | | +| -|End|PgD|Dow|Shift |xxx|
86 * `-----------------------------------------------------------' 86 * `-----------------------------------------------------------'
87 * |Gui |Alt |Space |Alt |Gui| 87 * |Gui |Alt |Space |Alt |xxx|
88 * `--------------------------------------------' 88 * `--------------------------------------------'
89 */ 89 */
90 KEYMAP(KB_PWR, KB_F1, KB_F2, KB_F3, KB_F4, KB_F5, KB_F6, KB_F7, KB_F8, KB_F9, KB_F10, KB_F11, KB_F12, KB_INS, KB_DEL, \ 90 KEYMAP(KB_PWR, KB_F1, KB_F2, KB_F3, KB_F4, KB_F5, KB_F6, KB_F7, KB_F8, KB_F9, KB_F10, KB_F11, KB_F12, KB_INS, KB_DEL, \
91 KB_CAPS,KB_NO, KB_NO, KB_NO, KB_NO, KB_NO, KB_NO, KB_NO, KB_PSCR,KB_SLCK,KB_BRK, KB_UP, KB_NO, KB_BSPC, \ 91 KB_CAPS,KB_NO, KB_NO, KB_NO, KB_NO, KB_NO, KB_NO, KB_NO, KB_PSCR,KB_SLCK,KB_BRK, KB_UP, KB_NO, KB_BSPC, \
92 KB_LCTL,KB_NO, KB_NO, KB_NO, KB_NO, KB_NO, KP_ASTR,KP_SLSH,KB_HOME,KB_PGUP,KB_LEFT,KB_RGHT,KB_ENT, \ 92 KB_LCTL,KB_NO, KB_NO, KB_NO, KB_NO, KB_NO, KP_ASTR,KP_SLSH,KB_HOME,KB_PGUP,KB_LEFT,KB_RGHT,KB_ENT, \
93 KB_LSFT,KB_NO, KB_NO, KB_NO, KB_NO, KB_NO, KP_PLUS,KP_MINS,KB_END, KB_PGDN,KB_DOWN,KB_RSFT,FN_1, \ 93 KB_LSFT,KB_NO, KB_NO, KB_NO, KB_NO, KB_NO, KP_PLUS,KP_MINS,KB_END, KB_PGDN,KB_DOWN,KB_RSFT,FN_1, \
94 KB_LGUI,KB_LALT,KB_SPC, KB_RALT,KB_RGUI), 94 KB_LGUI,KB_LALT,KB_SPC, KB_RALT,FN_7),
95 95
96 /* Layer 2: Vi mode (Quote/Rmeta) 96 /* Layer 2: Vi mode (Quote/Rmeta)
97 * ,-----------------------------------------------------------. 97 * ,-----------------------------------------------------------.
@@ -114,7 +114,7 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
114 114
115 /* Layer 3: Mouse mode (Semicolon) 115 /* Layer 3: Mouse mode (Semicolon)
116 * ,-----------------------------------------------------------. 116 * ,-----------------------------------------------------------.
117 * |Esc| | | | | | | | | | | | | | | 117 * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del|
118 * |-----------------------------------------------------------| 118 * |-----------------------------------------------------------|
119 * |Tab |MwL|MwU|McU|MwD|MwL|MwR|MwD|MwU|MwR| | | |Backs| 119 * |Tab |MwL|MwU|McU|MwD|MwL|MwR|MwD|MwU|MwR| | | |Backs|
120 * |-----------------------------------------------------------| 120 * |-----------------------------------------------------------|
@@ -181,15 +181,15 @@ int keymap_set_layer(int layer)
181} 181}
182 182
183inline 183inline
184bool keymap_is_special_mode(int fn_bits) 184bool keymap_is_special_mode(uint8_t fn_bits)
185{ 185{
186 return (keyboard_modifier_keys == (BIT_LCTRL | BIT_LSHIFT | BIT_LALT | BIT_LGUI)); 186 return (keyboard_modifier_keys == (BIT_LCTRL | BIT_LSHIFT | BIT_LALT | BIT_LGUI));
187} 187}
188 188
189void keymap_fn_proc(int fn_bits) 189void keymap_fn_proc(uint8_t fn_bits)
190{ 190{
191 // layer switching 191 // layer switching
192 static int last_bits = 0; 192 static uint8_t last_bits = 0;
193 static uint8_t last_mod = 0; 193 static uint8_t last_mod = 0;
194 194
195 if (usb_keyboard_has_key() || fn_bits == last_bits) { 195 if (usb_keyboard_has_key() || fn_bits == last_bits) {