aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--converter/m0110_usb/Makefile7
-rw-r--r--converter/m0110_usb/keymap.c181
2 files changed, 84 insertions, 104 deletions
diff --git a/converter/m0110_usb/Makefile b/converter/m0110_usb/Makefile
index 1fee258a6..bf0f083f6 100644
--- a/converter/m0110_usb/Makefile
+++ b/converter/m0110_usb/Makefile
@@ -35,9 +35,9 @@ F_CPU = 16000000
35# Build Options 35# Build Options
36# *Comment out* to disable the options. 36# *Comment out* to disable the options.
37# 37#
38MOUSEKEY_ENABLE = yes # Mouse keys 38#MOUSEKEY_ENABLE = yes # Mouse keys
39#PS2_MOUSE_ENABLE = yes # PS/2 mouse(TrackPoint) support 39#PS2_MOUSE_ENABLE = yes # PS/2 mouse(TrackPoint) support
40EXTRAKEY_ENABLE = yes # Audio control and System control 40#EXTRAKEY_ENABLE = yes # Audio control and System control
41#NKRO_ENABLE = yes # USB Nkey Rollover 41#NKRO_ENABLE = yes # USB Nkey Rollover
42 42
43 43
@@ -55,6 +55,3 @@ include $(TOP_DIR)/protocol/pjrc.mk
55include $(TOP_DIR)/protocol.mk 55include $(TOP_DIR)/protocol.mk
56include $(TOP_DIR)/common.mk 56include $(TOP_DIR)/common.mk
57include $(TOP_DIR)/rules.mk 57include $(TOP_DIR)/rules.mk
58
59hasu: EXTRAFLAGS += -DHASU
60hasu: all
diff --git a/converter/m0110_usb/keymap.c b/converter/m0110_usb/keymap.c
index d30d2b28f..191bf3a15 100644
--- a/converter/m0110_usb/keymap.c
+++ b/converter/m0110_usb/keymap.c
@@ -27,8 +27,65 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
27#include "keymap.h" 27#include "keymap.h"
28 28
29 29
30#define KEYCODE(layer, row, col) (pgm_read_byte(&keymaps[(layer)][(row)][(col)])) 30/*
31 * The keymap works with both M0110 and M0110A keyboards. As you can see, the M0110A is a superset
32 * of the M0110 keyboard, with only one exception: 'Enter' in M0110 does not exist
33 * on the M0110A, but since it generates a unique scan code which is not used for some other key in
34 * the M0110A, they are totally interchangeable. In fact, the M0110A is functionally (almost)
35 * identical to the combination of the M0110 along with the M0120 keypad. The only difference
36 * (which is causing some problems as you will read below) is that the M0110+M0120 don't have
37 * dedicated arrow keys, while the M0110A does. However, the M0120 did have arrow keys, which
38 * doubled as the [comma], [/], [*] and [+] keys, when used with the [Shift] key. The M0110A has
39 * substituted the [comma] key with the [=] key, however its scancode is the same.
40 *
41 * Physical layout:
42 * M0110A
43 * ,---------------------------------------------------------. ,---------------.
44 * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Bcksp| |Clr| =| /| *|
45 * |---------------------------------------------------------| |---------------|
46 * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| | | 7| 8| 9| -|
47 * |-----------------------------------------------------' | |---------------|
48 * |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return| | 4| 5| 6| +|
49 * |---------------------------------------------------------| |---------------|
50 * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shft|Up | | 1| 2| 3| |
51 * |---------------------------------------------------------' |-----------|Ent|
52 * |Opt |Mac | Space | \|Lft|Rgt|Dn | | 0| .| |
53 * `---------------------------------------------------------' `---------------'
54 *
55 * M0110 M0120
56 * ,---------------------------------------------------------. ,---------------.
57 * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backs| |Clr| -| +| *|
58 * |---------------------------------------------------------| |---------------|
59 * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | 7| 8| 9| /|
60 * |---------------------------------------------------------| |---------------|
61 * |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return| | 4| 5| 6| ,|
62 * |---------------------------------------------------------| |---------------|
63 * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shift | | 1| 2| 3| |
64 * `---------------------------------------------------------' |-----------|Ent|
65 * |Opt|Mac | Space |Ent |Opt| | 0| .| |
66 * `-----------------------------------------------' `---------------'
67 * With Shift keys on M0120 work as curosor.(-:Left *:Right /:Up ,:Down)
68 *
69 * NOTE: \ is located differently.
70 * NOTE: Enter on M0110 is different from Enter on keypad(M0120 and M0110A).
71 * NOTE: Left Shift and right Shift are logically same key.
72 * NOTE: Left Option and right Option are logically same key.
73 */
31 74
75/* Keymap definition Macro
76 * ,---------------------------------------------------------. ,---------------.
77 * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backs| |Clr| =| /| *|
78 * |---------------------------------------------------------| |---------------|
79 * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| | | 7| 8| 9| -|
80 * |-----------------------------------------------------' | |---------------|
81 * |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return| | 4| 5| 6| +|
82 * |---------------------------------------------------------| |---------------|
83 * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shft|Up | | 1| 2| 3| |
84 * |---------------------------------------------------------| |-----------|Ent|
85 * |Opt |Mac | Space |Ent| \|Lft|Rgt|Dn | | 0| .| |
86 * `---------------------------------------------------------' `---------------'
87 * NOTE: Ent between Space and \ means Enter on M0110.
88 */
32#define KEYMAP( \ 89#define KEYMAP( \
33 K32,K12,K13,K14,K15,K17,K16,K1A,K1C,K19,K1D,K1B,K18,K33, K47,K68,K6D,K62, \ 90 K32,K12,K13,K14,K15,K17,K16,K1A,K1C,K19,K1D,K1B,K18,K33, K47,K68,K6D,K62, \
34 K30,K0C,K0D,K0E,K0F,K11,K10,K20,K22,K1F,K23,K21,K1E, K59,K5B,K5C,K4E, \ 91 K30,K0C,K0D,K0E,K0F,K11,K10,K20,K22,K1F,K23,K21,K1E, K59,K5B,K5C,K4E, \
@@ -52,10 +109,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
52 { KC_##K68, KC_NO, KC_NO, KC_NO, KC_NO, KC_##K6D, KC_NO, KC_NO }, \ 109 { KC_##K68, KC_NO, KC_NO, KC_NO, KC_NO, KC_##K6D, KC_NO, KC_NO }, \
53} 110}
54 111
112#define KEYCODE(layer, row, col) (pgm_read_byte(&keymaps[(layer)][(row)][(col)]))
113
55 114
56// Assign Fn key(0-7) to a layer to which switch with the Fn key pressed. 115// Assign Fn key(0-7) to a layer to which switch with the Fn key pressed.
57static const uint8_t PROGMEM fn_layer[] = { 116static const uint8_t PROGMEM fn_layer[] = {
58#ifndef HASU
59 1, // Fn0 117 1, // Fn0
60 0, // Fn1 118 0, // Fn1
61 0, // Fn2 119 0, // Fn2
@@ -64,22 +122,11 @@ static const uint8_t PROGMEM fn_layer[] = {
64 0, // Fn5 122 0, // Fn5
65 0, // Fn6 123 0, // Fn6
66 0 // Fn7 124 0 // Fn7
67#else
68 1, // Fn0
69 2, // Fn1
70 3, // Fn2
71 1, // Fn3
72 2, // Fn4
73 0, // Fn5
74 0, // Fn6
75 0 // Fn7
76#endif
77}; 125};
78 126
79// Assign Fn key(0-7) to a keycode sent when release Fn key without use of the layer. 127// Assign Fn key(0-7) to a keycode sent when release Fn key without use of the layer.
80// See layer.c for details. 128// See layer.c for details.
81static const uint8_t PROGMEM fn_keycode[] = { 129static const uint8_t PROGMEM fn_keycode[] = {
82#ifndef HASU
83 KC_NO, // Fn0 130 KC_NO, // Fn0
84 KC_NO, // Fn1 131 KC_NO, // Fn1
85 KC_NO, // Fn2 132 KC_NO, // Fn2
@@ -88,33 +135,12 @@ static const uint8_t PROGMEM fn_keycode[] = {
88 KC_NO, // Fn5 135 KC_NO, // Fn5
89 KC_NO, // Fn6 136 KC_NO, // Fn6
90 KC_NO // Fn7 137 KC_NO // Fn7
91#else
92 KC_ENTER, // Fn0
93 KC_SCOLON, // Fn1
94 KC_SLASH, // Fn2
95 KC_UP, // Fn3
96 KC_NO, // Fn4
97 KC_NO, // Fn5
98 KC_NO, // Fn6
99 KC_NO // Fn7
100#endif
101}; 138};
102 139
103static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 140static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
104 /* 141 /* Default:
105 * The keymap works with both M0110 and M0110A keyboards. As you can see, the M0110A is a superset
106 * of the M0110 keyboard, with only one exception: 'Enter' in M0110 does not exist
107 * on the M0110A, but since it generates a unique scan code which is not used for some other key in
108 * the M0110A, they are totally interchangeable. In fact, the M0110A is functionally (almost)
109 * identical to the combination of the M0110 along with the M0120 keypad. The only difference
110 * (which is causing some problems as you will read below) is that the M0110+M0120 don't have
111 * dedicated arrow keys, while the M0110A does. However, the M0120 did have arrow keys, which
112 * doubled as the [comma], [/], [*] and [+] keys, when used with the [Shift] key. The M0110A has
113 * substituted the [comma] key with the [=] key, however its scancode is the same.
114 *
115 * Default:
116 * ,---------------------------------------------------------. ,---------------. 142 * ,---------------------------------------------------------. ,---------------.
117 * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backs| |Gui| =| /| *| 143 * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backs| |Ctl| =| /| *|
118 * |---------------------------------------------------------| |---------------| 144 * |---------------------------------------------------------| |---------------|
119 * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| | | 7| 8| 9| -| 145 * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| | | 7| 8| 9| -|
120 * |-----------------------------------------------------' | |---------------| 146 * |-----------------------------------------------------' | |---------------|
@@ -122,79 +148,36 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
122 * |---------------------------------------------------------| |---------------| 148 * |---------------------------------------------------------| |---------------|
123 * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shft|Up | | 1| 2| 3| | 149 * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shft|Up | | 1| 2| 3| |
124 * |---------------------------------------------------------| |-----------|Ent| 150 * |---------------------------------------------------------| |-----------|Ent|
125 * |Ctrl |Alt | Space |Gui| \|Lft|Rgt|Dn | | 0| .| | 151 * |Alt |Gui | Space |Ctl| \|Lft|Rgt|Dn | | 0| .| |
126 * `---------------------------------------------------------' `---------------' 152 * `---------------------------------------------------------' `---------------'
127 *
128 * HHKB/WASD/Mouse Layer(Fn0):
129 * ,---------------------------------------------------------. ,---------------.
130 * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delet| |Nlk|Mb1|Mb3|Mb2|
131 * |---------------------------------------------------------| |---------------|
132 * |Caps |Hom| Up|PgU| | | | |Psc|Slk|Pau|Up |Ins| | |MwD|McU|MwU|MwU|
133 * |-----------------------------------------------------' | |---------------|
134 * |Fn0 |Lef|Dow|Rig| | | | |Hom|PgU|Lef|Rig|Return| |McL|McD|McR|MwD|
135 * |---------------------------------------------------------| |---------------|
136 * |Shift |End| |PgD| |VoD|VoU|Mut|End|PgD|Dow|Shif|Up | |MwL|McD|MwR| |
137 * |---------------------------------------------------------| |-----------|Mb2|
138 * |Ctrl |Alt | Space |Gui | \|Lft|Rgt|Dn | | Mb1|Mb3| |
139 * `---------------------------------------------------------' `---------------'
140 * Mb: Mouse Button / Mc: Mouse Cursor / Mw: Mouse Wheel
141 *
142 * NOTE: M0110 has no arrow and keypad keys.
143 * NOTE: \ is located next to ] on M0110.
144 * NOTE: Gui between Space and \ is Enter on M0110 not exists on M0110A.
145 * NOTE: LShift and RShift are logically same key. (M0110, M0110A)
146 * NOTE: LOption and ROption are logically same key. (M0110)
147 */ 153 */
148#ifndef HASU
149 KEYMAP( 154 KEYMAP(
150 GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, LGUI,EQL, PSLS,PAST, 155 GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, LCTL,EQL, PSLS,PAST,
151 TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, P7, P8, P9, PMNS, 156 TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, P7, P8, P9, PMNS,
152 FN0, A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, P4, P5, P6, PPLS, 157 FN0, A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, P4, P5, P6, PPLS,
153 LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, UP, P1, P2, P3, PENT, 158 LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, UP, P1, P2, P3, PENT,
154 LCTL,LALT, SPC, LGUI,BSLS,LEFT,RGHT,DOWN, P0, PDOT 159 LALT,LGUI, SPC, LCTL,BSLS,LEFT,RGHT,DOWN, P0, PDOT
155 ), 160 ),
156 // HHKB & WASD 161 /* Cursor Layer(WASD, IJKL)
157 KEYMAP( 162 * ,---------------------------------------------------------. ,---------------.
158 ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, NLCK,EQL, PSLS,PAST, 163 * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delet| |Nlk| =| /| *|
159 CAPS,HOME,UP, PGUP,NO, NO, NO, NO, PSCR,SLCK,PAUS,UP, NO, P7, P8, P9, PMNS, 164 * |---------------------------------------------------------| |---------------|
160 FN0, LEFT,DOWN,RGHT,NO, NO, NO, NO, HOME,PGUP,LEFT,RGHT, ENT, P4, P5, P6, PPLS, 165 * |Caps |Hom| Up|PgU| | | |PgU| Up|Hom|Psc|Slk|Pau| | | 7| 8| 9| -|
161 LSFT,END, NO, PGDN,NO, VOLD,VOLU,MUTE,END, PGDN,DOWN, PGUP, P1, P2, P3, PENT, 166 * |-----------------------------------------------------' | |---------------|
162 LCTL,LALT, SPC, LGUI,INS, HOME,END, PGDN, P0, PDOT 167 * |Fn0 |Lef|Dow|Rig| | | |Lef|Dow|Rig| | |Return| | 4| 5| 6| +|
163 ), 168 * |---------------------------------------------------------| |---------------|
164#else 169 * |Shift |End| |PgD| | | |PgD| |End| |Shif|PgU| | 1| 2| 3| |
165 // hasu's keymap(To enable this use 'make hasu' to add option flag: EXTRAFLAGS=-DHASU) 170 * |---------------------------------------------------------| |-----------|Ent|
166 KEYMAP( 171 * |Alt |Gui | Space |Gui |Ins|Hom|End|PgD| | 0| .| |
167 GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, LGUI,EQL, PSLS,PAST, 172 * `---------------------------------------------------------' `---------------'
168 TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, P7, P8, P9, PMNS, 173 */
169 LCTL,A, S, D, F, G, H, J, K, L, FN1, QUOT, FN0, P4, P5, P6, PPLS,
170 LSFT,Z, X, C, V, B, N, M, COMM,DOT, FN2, FN3, P1, P2, P3, PENT,
171 FN4, LALT, SPC, LGUI,BSLS,LEFT,RGHT,DOWN, LGUI, PDOT
172 ),
173 // HHKB & WASD
174 KEYMAP(
175 ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, NLCK,EQL, PSLS,PAST,
176 CAPS,HOME,UP, PGUP,NO, NO, NO, NO, PSCR,SLCK,PAUS,UP, NO, P7, P8, P9, PMNS,
177 LCTL,LEFT,DOWN,RGHT,NO, NO, NO, NO, HOME,PGUP,LEFT,RGHT, FN0, P4, P5, P6, PPLS,
178 LSFT,END, NO, PGDN,NO, VOLD,VOLU,MUTE,END, PGDN,DOWN, FN3, P1, P2, P3, PENT,
179 LCTL,LALT, SPC, LGUI,INS, LEFT,RGHT,DOWN, P0, PDOT
180 ),
181 // vi mousekeys
182 KEYMAP(
183 ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, NLCK,EQL, PSLS,PAST,
184 CAPS,NO, NO, NO, NO, NO, WH_L,WH_D,WH_U,WH_R,PSCR,SLCK,PAUS, P7, P8, P9, PMNS,
185 LCTL,VOLD,VOLU,MUTE,NO, NO, MS_L,MS_D,MS_U,MS_R,FN1, NO, ENT, P4, P5, P6, PPLS,
186 LSFT,NO, NO, NO, NO, BTN3,BTN2,BTN1,NO, NO, NO, UP, P1, P2, P3, PENT,
187 FN4, LALT, BTN1, LGUI,NO, LEFT,RGHT,DOWN, P0, PDOT
188 ),
189 // vi cusorkeys
190 KEYMAP( 174 KEYMAP(
191 ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, NLCK,EQL, PSLS,PAST, 175 ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, NLCK,EQL, PSLS,PAST,
192 CAPS,NO, NO, NO, NO, NO, HOME,PGDN,PGUP,END, PSCR,SLCK,PAUS, P7, P8, P9, PMNS, 176 CAPS,HOME,UP, PGUP,NO, NO, NO, PGUP,UP, HOME,PSCR,SLCK,PAUS, P7, P8, P9, PMNS,
193 LCTL,NO, NO, NO, NO, NO, LEFT,DOWN,UP, RGHT,NO, NO, ENT, P4, P5, P6, PPLS, 177 FN0, LEFT,DOWN,RGHT,NO, NO, NO, LEFT,DOWN,RGHT,NO, NO, ENT, P4, P5, P6, PPLS,
194 LSFT,NO, NO, NO, NO, NO, HOME,PGDN,PGUP,END, FN2, UP, P1, P2, P3, PENT, 178 LSFT,END, NO, PGDN,NO, NO, NO, PGDN,NO, END, NO, PGUP, P1, P2, P3, PENT,
195 LCTL,LALT, SPC, LGUI,INS, LEFT,RGHT,DOWN, P0, PDOT 179 LALT,LGUI, SPC, LCTL,INS, HOME,END, PGDN, P0, PDOT
196 ), 180 ),
197#endif
198}; 181};
199 182
200 183