aboutsummaryrefslogtreecommitdiff
path: root/keyboards/converter
diff options
context:
space:
mode:
authorQMK Bot <hello@qmk.fm>2021-08-20 13:14:35 +0000
committerQMK Bot <hello@qmk.fm>2021-08-20 13:14:35 +0000
commitda11a49905605871eea66f8f03b2c4b46d1de88a (patch)
tree15b84170a4451bb7537312ff0e0c6f142582e139 /keyboards/converter
parent69c71d4843586fad9c29c4dd945aa170f9990d8e (diff)
parent90ff4fe749346c3b92aa8ca6461f5091fabfa99e (diff)
downloadqmk_firmware-da11a49905605871eea66f8f03b2c4b46d1de88a.tar.gz
qmk_firmware-da11a49905605871eea66f8f03b2c4b46d1de88a.zip
Merge remote-tracking branch 'origin/master' into develop
Diffstat (limited to 'keyboards/converter')
-rw-r--r--keyboards/converter/modelm_ssk/config.h76
-rw-r--r--keyboards/converter/modelm_ssk/info.json457
-rw-r--r--keyboards/converter/modelm_ssk/keymaps/default/keymap.c114
-rw-r--r--keyboards/converter/modelm_ssk/keymaps/default/readme.md1
-rw-r--r--keyboards/converter/modelm_ssk/keymaps/tiltowait/config.h21
-rw-r--r--keyboards/converter/modelm_ssk/keymaps/tiltowait/keymap.c116
-rw-r--r--keyboards/converter/modelm_ssk/keymaps/tiltowait/readme.md11
-rw-r--r--keyboards/converter/modelm_ssk/modelm_ssk.c19
-rw-r--r--keyboards/converter/modelm_ssk/modelm_ssk.h45
-rw-r--r--keyboards/converter/modelm_ssk/readme.md55
-rw-r--r--keyboards/converter/modelm_ssk/rules.mk23
11 files changed, 938 insertions, 0 deletions
diff --git a/keyboards/converter/modelm_ssk/config.h b/keyboards/converter/modelm_ssk/config.h
new file mode 100644
index 000000000..74d549ba4
--- /dev/null
+++ b/keyboards/converter/modelm_ssk/config.h
@@ -0,0 +1,76 @@
1/*
2Copyright 2019-2021 iw0rm3r, tiltowait
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#pragma once
19
20#include "config_common.h"
21
22/* USB Device descriptor parameter */
23#define VENDOR_ID 0xFEED
24#define PRODUCT_ID 0x0000
25#define DEVICE_VER 0x0001
26#define MANUFACTURER tiltowait
27#define PRODUCT IBM Model M Space-Saving Keyboard
28
29/* key matrix size */
30#define MATRIX_ROWS 8
31#define MATRIX_COLS 16
32
33/*
34 * Keyboard Matrix Assignments
35 *
36 * Change this to how you wired your keyboard
37 * COLS: AVR pins used for columns, left to right
38 * ROWS: AVR pins used for rows, top to bottom
39 * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
40 * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
41 *
42*/
43#define MATRIX_COL_PINS { C7, C6, C5, C4, C3, C2, C1, C0, E1, E0, D7, D5, D4, D3, D2, D1 }
44#define MATRIX_ROW_PINS { F0, F1, F2, F3, F4, F5, F6, F7 }
45#define UNUSED_PINS
46
47/* COL2ROW, ROW2COL*/
48#define DIODE_DIRECTION ROW2COL
49
50/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed (5 is default) */
51#define DEBOUNCE 5
52
53/* The Model M does not have NKRO */
54#define MATRIX_HAS_GHOST
55
56#define LED_NUM_LOCK_PIN B4
57#define LED_CAPS_LOCK_PIN B6
58#define LED_SCROLL_LOCK_PIN B5
59
60/*
61 * Feature disable options
62 * These options are also useful to firmware size reduction.
63 */
64
65/* disable debug print */
66//#define NO_DEBUG
67
68/* disable print */
69//#define NO_PRINT
70
71/* disable action features */
72//#define NO_ACTION_LAYER
73//#define NO_ACTION_TAPPING
74//#define NO_ACTION_ONESHOT
75//#define NO_ACTION_MACRO
76//#define NO_ACTION_FUNCTION
diff --git a/keyboards/converter/modelm_ssk/info.json b/keyboards/converter/modelm_ssk/info.json
new file mode 100644
index 000000000..e347d6672
--- /dev/null
+++ b/keyboards/converter/modelm_ssk/info.json
@@ -0,0 +1,457 @@
1{
2 "keyboard_name": "IBM Model M Space-Saving Keyboard",
3 "url": "https://github.com/tiltowait/qmk_firmware/tree/modelm_ssk/keyboards/converter/modelm_ssk",
4 "maintainer": "tiltowait",
5 "width": 17.75,
6 "height": 6.5,
7 "layouts":
8 {
9 "LAYOUT":
10 {
11 "layout":
12 [
13 {
14 "label": "Esc",
15 "x": 0,
16 "y": 0
17 },
18 {
19 "label": "F1",
20 "x": 2,
21 "y": 0
22 },
23 {
24 "label": "F2",
25 "x": 3,
26 "y": 0
27 },
28 {
29 "label": "F3",
30 "x": 4,
31 "y": 0
32 },
33 {
34 "label": "F4",
35 "x": 5,
36 "y": 0
37 },
38 {
39 "label": "F5",
40 "x": 6.5,
41 "y": 0
42 },
43 {
44 "label": "F6",
45 "x": 7.5,
46 "y": 0
47 },
48 {
49 "label": "F7",
50 "x": 8.5,
51 "y": 0
52 },
53 {
54 "label": "F8",
55 "x": 9.5,
56 "y": 0
57 },
58 {
59 "label": "F9",
60 "x": 11,
61 "y": 0
62 },
63 {
64 "label": "F10",
65 "x": 12,
66 "y": 0
67 },
68 {
69 "label": "F11",
70 "x": 13,
71 "y": 0
72 },
73 {
74 "label": "F12",
75 "x": 14,
76 "y": 0
77 },
78 {
79 "label": "PrtSc",
80 "x": 15.25,
81 "y": 0
82 },
83 {
84 "label": "Scroll Lock",
85 "x": 16.25,
86 "y": 0
87 },
88 {
89 "label": "Pause",
90 "x": 17.25,
91 "y": 0
92 },
93 {
94 "label": "~",
95 "x": 0,
96 "y": 1.5
97 },
98 {
99 "label": "!",
100 "x": 1,
101 "y": 1.5
102 },
103 {
104 "label": "@",
105 "x": 2,
106 "y": 1.5
107 },
108 {
109 "label": "#",
110 "x": 3,
111 "y": 1.5
112 },
113 {
114 "label": "$",
115 "x": 4,
116 "y": 1.5
117 },
118 {
119 "label": "%",
120 "x": 5,
121 "y": 1.5
122 },
123 {
124 "label": "^",
125 "x": 6,
126 "y": 1.5
127 },
128 {
129 "label": "&",
130 "x": 7,
131 "y": 1.5
132 },
133 {
134 "label": "*",
135 "x": 8,
136 "y": 1.5
137 },
138 {
139 "label": "(",
140 "x": 9,
141 "y": 1.5
142 },
143 {
144 "label": ")",
145 "x": 10,
146 "y": 1.5
147 },
148 {
149 "label": "_",
150 "x": 11,
151 "y": 1.5
152 },
153 {
154 "label": "+",
155 "x": 12,
156 "y": 1.5
157 },
158 {
159 "label": "Backspace",
160 "x": 13,
161 "y": 1.5,
162 "w": 2
163 },
164 {
165 "label": "Insert",
166 "x": 15.25,
167 "y": 1.5
168 },
169 {
170 "label": "Home",
171 "x": 16.25,
172 "y": 1.5
173 },
174 {
175 "label": "PgUp",
176 "x": 17.25,
177 "y": 1.5
178 },
179 {
180 "label": "Tab",
181 "x": 0,
182 "y": 2.5,
183 "w": 1.5
184 },
185 {
186 "label": "Q",
187 "x": 1.5,
188 "y": 2.5
189 },
190 {
191 "label": "W",
192 "x": 2.5,
193 "y": 2.5
194 },
195 {
196 "label": "E",
197 "x": 3.5,
198 "y": 2.5
199 },
200 {
201 "label": "R",
202 "x": 4.5,
203 "y": 2.5
204 },
205 {
206 "label": "T",
207 "x": 5.5,
208 "y": 2.5
209 },
210 {
211 "label": "Y",
212 "x": 6.5,
213 "y": 2.5
214 },
215 {
216 "label": "U",
217 "x": 7.5,
218 "y": 2.5
219 },
220 {
221 "label": "I",
222 "x": 8.5,
223 "y": 2.5
224 },
225 {
226 "label": "O",
227 "x": 9.5,
228 "y": 2.5
229 },
230 {
231 "label": "P",
232 "x": 10.5,
233 "y": 2.5
234 },
235 {
236 "label": "{",
237 "x": 11.5,
238 "y": 2.5
239 },
240 {
241 "label": "}",
242 "x": 12.5,
243 "y": 2.5
244 },
245 {
246 "label": "|",
247 "x": 13.5,
248 "y": 2.5,
249 "w": 1.5
250 },
251 {
252 "label": "Delete",
253 "x": 15.25,
254 "y": 2.5
255 },
256 {
257 "label": "End",
258 "x": 16.25,
259 "y": 2.5
260 },
261 {
262 "label": "PgDn",
263 "x": 17.25,
264 "y": 2.5
265 },
266 {
267 "label": "Caps Lock",
268 "x": 0,
269 "y": 3.5,
270 "w": 1.5
271 },
272 {
273 "label": "A",
274 "x": 1.75,
275 "y": 3.5
276 },
277 {
278 "label": "S",
279 "x": 2.75,
280 "y": 3.5
281 },
282 {
283 "label": "D",
284 "x": 3.75,
285 "y": 3.5
286 },
287 {
288 "label": "F",
289 "x": 4.75,
290 "y": 3.5
291 },
292 {
293 "label": "G",
294 "x": 5.75,
295 "y": 3.5
296 },
297 {
298 "label": "H",
299 "x": 6.75,
300 "y": 3.5
301 },
302 {
303 "label": "J",
304 "x": 7.75,
305 "y": 3.5
306 },
307 {
308 "label": "K",
309 "x": 8.75,
310 "y": 3.5
311 },
312 {
313 "label": "L",
314 "x": 9.75,
315 "y": 3.5
316 },
317 {
318 "label": ":",
319 "x": 10.75,
320 "y": 3.5
321 },
322 {
323 "label": "\"",
324 "x": 11.75,
325 "y": 3.5
326 },
327 {
328 "label": "~",
329 "x": 12.75,
330 "y": 3.5
331 },
332 {
333 "label": "Enter",
334 "x": 13.75,
335 "y": 3.5,
336 "w": 1.25
337 },
338 {
339 "label": "Shift",
340 "x": 0,
341 "y": 4.5,
342 "w": 1.25
343 },
344 {
345 "label": "|",
346 "x": 1.25,
347 "y": 4.5
348 },
349 {
350 "label": "Z",
351 "x": 2.25,
352 "y": 4.5
353 },
354 {
355 "label": "X",
356 "x": 3.25,
357 "y": 4.5
358 },
359 {
360 "label": "C",
361 "x": 4.25,
362 "y": 4.5
363 },
364 {
365 "label": "V",
366 "x": 5.25,
367 "y": 4.5
368 },
369 {
370 "label": "B",
371 "x": 6.25,
372 "y": 4.5
373 },
374 {
375 "label": "N",
376 "x": 7.25,
377 "y": 4.5
378 },
379 {
380 "label": "M",
381 "x": 8.25,
382 "y": 4.5
383 },
384 {
385 "label": "<",
386 "x": 9.25,
387 "y": 4.5
388 },
389 {
390 "label": ">",
391 "x": 10.25,
392 "y": 4.5
393 },
394 {
395 "label": "?",
396 "x": 11.25,
397 "y": 4.5
398 },
399 {
400 "label": "Shift",
401 "x": 12.25,
402 "y": 4.5,
403 "w": 2.75
404 },
405 {
406 "label": "↑",
407 "x": 16.25,
408 "y": 4.5
409 },
410 {
411 "label": "Ctrl",
412 "x": 0,
413 "y": 5.5,
414 "w": 1.5
415 },
416 {
417 "label": "Alt",
418 "x": 2.5,
419 "y": 5.5,
420 "w": 1.5
421 },
422 {
423 "x": 4,
424 "y": 5.5,
425 "w": 7
426 },
427 {
428 "label": "Alt",
429 "x": 11,
430 "y": 5.5,
431 "w": 1.5
432 },
433 {
434 "label": "Ctrl",
435 "x": 13.5,
436 "y": 5.5,
437 "w": 1.5
438 },
439 {
440 "label": "←",
441 "x": 15.25,
442 "y": 5.5
443 },
444 {
445 "label": "↓",
446 "x": 16.25,
447 "y": 5.5
448 },
449 {
450 "label": "→",
451 "x": 17.25,
452 "y": 5.5
453 }
454 ]
455 }
456 }
457}
diff --git a/keyboards/converter/modelm_ssk/keymaps/default/keymap.c b/keyboards/converter/modelm_ssk/keymaps/default/keymap.c
new file mode 100644
index 000000000..adf557b26
--- /dev/null
+++ b/keyboards/converter/modelm_ssk/keymaps/default/keymap.c
@@ -0,0 +1,114 @@
1/* Copyright 2019-2021 iw0rm3r, tiltowait
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#include QMK_KEYBOARD_H
17
18enum custom_layers {
19 _BASE,
20 _NUMPAD,
21};
22
23enum custom_keycodes {
24 NUM_SCRL = SAFE_RANGE
25};
26
27void toggle_numpad_layer(int set_state);
28
29const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
30 [_BASE] = LAYOUT( /* Base layer */
31 KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, NUM_SCRL, KC_PAUS,
32 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP,
33 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN,
34 KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT,
35 KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP,
36 KC_LCTL, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
37 ),
38 [_NUMPAD] = LAYOUT( /* Numpad Layer */
39 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
40
41 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_KP_7, KC_KP_8, KC_KP_9, KC_TRNS, KC_KP_MINUS, KC_KP_PLUS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
42 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_KP_4, KC_KP_5, KC_KP_6, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
43 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_ASTERISK, KC_TRNS, KC_TRNS, KC_TRNS,
44 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_KP_0, KC_TRNS, KC_KP_DOT, KC_KP_SLASH, KC_TRNS, KC_TRNS,
45 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
46 ),
47};
48
49bool process_record_user(uint16_t keycode, keyrecord_t *record) {
50 static uint16_t last_num_scroll = 0; /* For unregistering the proper key */
51
52 switch (keycode) {
53 case NUM_SCRL: /* Numlock / Scroll Lock */
54 if (record->event.pressed) {
55 if (get_mods() & MOD_MASK_SHIFT) {
56 /* Remove the shift modifiers */
57 uint8_t shift_mods = get_mods() & (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT));
58 del_mods(MOD_MASK_SHIFT);
59
60 last_num_scroll = KC_NUMLOCK;
61 register_code(last_num_scroll);
62 toggle_numpad_layer(-1);
63
64 /* Reset the shift modifiers */
65 set_mods(shift_mods);
66 } else {
67 last_num_scroll = KC_SCROLLLOCK;
68 register_code(last_num_scroll);
69 }
70 } else {
71 unregister_code(last_num_scroll);
72 }
73 break;
74 }
75 return true;
76}
77
78void toggle_numpad_layer(int set_state) {
79 static uint8_t numlock_enabled = 0;
80
81 /* set_state allows us to explicitly change the numlock state
82 rather than merely toggling it. */
83 if (set_state == -1) {
84 numlock_enabled = !numlock_enabled;
85 } else {
86 numlock_enabled = set_state;
87 }
88
89 if (numlock_enabled) {
90 layer_on(_NUMPAD);
91 }
92 else {
93 layer_off(_NUMPAD);
94 }
95}
96
97bool led_update_user(led_t led_state) {
98 /* In rare and unlikely conditions, it's possible for numlock
99 state to change externally from the keyboard. If this happens,
100 we want to match the new state.
101
102 On Windows and Linux, this means that the keyboard will technically
103 toggle the numpad layer twice.
104 */
105
106 static int8_t numlock_state = -1; /* Unknown state at default */
107
108 if (led_state.num_lock != numlock_state) {
109 numlock_state = led_state.num_lock;
110 toggle_numpad_layer(led_state.num_lock);
111 }
112 return true;
113}
114
diff --git a/keyboards/converter/modelm_ssk/keymaps/default/readme.md b/keyboards/converter/modelm_ssk/keymaps/default/readme.md
new file mode 100644
index 000000000..bc829be26
--- /dev/null
+++ b/keyboards/converter/modelm_ssk/keymaps/default/readme.md
@@ -0,0 +1 @@
# The default keymap for modelm_ssk
diff --git a/keyboards/converter/modelm_ssk/keymaps/tiltowait/config.h b/keyboards/converter/modelm_ssk/keymaps/tiltowait/config.h
new file mode 100644
index 000000000..151118fdf
--- /dev/null
+++ b/keyboards/converter/modelm_ssk/keymaps/tiltowait/config.h
@@ -0,0 +1,21 @@
1/* Copyright 2021 tiltowait
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#pragma once
18
19// place overrides here
20
21#define PERMISSIVE_HOLD
diff --git a/keyboards/converter/modelm_ssk/keymaps/tiltowait/keymap.c b/keyboards/converter/modelm_ssk/keymaps/tiltowait/keymap.c
new file mode 100644
index 000000000..58726fec8
--- /dev/null
+++ b/keyboards/converter/modelm_ssk/keymaps/tiltowait/keymap.c
@@ -0,0 +1,116 @@
1/* Copyright 2021 tiltowait
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#include QMK_KEYBOARD_H
17
18enum custom_layers {
19 _BASE,
20 _SECOND,
21 _NUMPAD,
22};
23
24enum custom_keycodes {
25 NUM_SCRL = SAFE_RANGE /* Dual-purpose Scroll Lock / Numlock button as on original hardware */
26};
27
28void toggle_numlock_layer(int set_state);
29
30const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
31 [_BASE] = LAYOUT( /* Base layer */
32 KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_MUTE, KC_F10, KC_VOLD, KC_VOLU, S(G(KC_4)), NUM_SCRL, KC_PAUS,
33
34 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_INS, KC_HOME, KC_PGUP,
35 LT(_SECOND,KC_TAB), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_DEL, KC_END, KC_PGDN,
36 KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT,
37 KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP,
38 KC_LALT, LGUI_T(KC_ENT), KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
39 ),
40 [_SECOND] = LAYOUT( /* Layer 1 */
41 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
42
43 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, S(A(KC_MINS)), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
44 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, C(KC_LEFT), C(KC_RGHT), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
45 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, S(A(KC_M)), KC_TRNS, KC_TRNS, KC_TRNS,
46 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_ENT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
47 KC_TRNS, KC_TRNS, C(KC_SPC), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
48 ),
49 [_NUMPAD] = LAYOUT( /* Numpad Layer */
50 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
51
52 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_KP_7, KC_KP_8, KC_KP_9, KC_TRNS, KC_KP_MINUS, KC_KP_PLUS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
53 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_KP_4, KC_KP_5, KC_KP_6, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
54 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_ASTERISK, KC_TRNS, KC_TRNS, KC_TRNS,
55 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_KP_0, KC_TRNS, KC_KP_DOT, KC_KP_SLASH, KC_TRNS, KC_TRNS,
56 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
57 ),
58};
59
60bool process_record_user(uint16_t keycode, keyrecord_t *record) {
61 static uint16_t last_num_scroll = 0; /* For unregistering the proper key */
62
63 switch (keycode) {
64 case NUM_SCRL:
65 if (record->event.pressed) {
66 if (get_mods() & MOD_MASK_SHIFT) {
67 /* Remove the shift modifiers */
68 uint8_t shift_mods = get_mods() & (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT));
69 set_mods(get_mods() & ~(MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) );
70
71 last_num_scroll = KC_NUMLOCK;
72 register_code(last_num_scroll);
73 toggle_numlock_layer(-1);
74
75 /* Reset the shift modifiers */
76 set_mods(shift_mods);
77 } else {
78 last_num_scroll = KC_SCROLLLOCK;
79 register_code(last_num_scroll);
80 }
81 } else {
82 unregister_code(last_num_scroll);
83 }
84 break;
85 }
86 return true;
87}
88
89void toggle_numlock_layer(int set_state) {
90 static uint8_t numlock_enabled = 0;
91
92 /* set_state allows us to explicitly change the numlock state
93 rather than merely toggling it. */
94 if (set_state == -1) {
95 numlock_enabled = !numlock_enabled;
96 } else {
97 numlock_enabled = set_state;
98 }
99
100 if (numlock_enabled) {
101 layer_on(_NUMPAD);
102 }
103 else {
104 layer_off(_NUMPAD);
105 }
106}
107
108bool led_update_kb(led_t led_state) {
109 static int8_t numlock_state = -1;
110
111 if (led_state.num_lock != numlock_state) {
112 numlock_state = led_state.num_lock;
113 toggle_numlock_layer(led_state.num_lock);
114 }
115 return true;
116}
diff --git a/keyboards/converter/modelm_ssk/keymaps/tiltowait/readme.md b/keyboards/converter/modelm_ssk/keymaps/tiltowait/readme.md
new file mode 100644
index 000000000..aecdd89b8
--- /dev/null
+++ b/keyboards/converter/modelm_ssk/keymaps/tiltowait/readme.md
@@ -0,0 +1,11 @@
1# The maintainer's personal keymap for modelm_ssk
2
3This is a keymap suitable for macOS use.
4
5* Backspace and backslash have been swapped (HHKB style)
6* Capslock is LCTRL
7* LCTRL is LALT
8* LALT is LGUI
9* Tab shifts to layer 1 on hold
10* Layer 1 has a couple of Mac shortcuts, plus Vim-style arrow keys
11* Shift+Numlock enables numlock
diff --git a/keyboards/converter/modelm_ssk/modelm_ssk.c b/keyboards/converter/modelm_ssk/modelm_ssk.c
new file mode 100644
index 000000000..1b01115e5
--- /dev/null
+++ b/keyboards/converter/modelm_ssk/modelm_ssk.c
@@ -0,0 +1,19 @@
1/* Copyright 2019 iw0rm3r
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#include "modelm_ssk.h"
17
18
19
diff --git a/keyboards/converter/modelm_ssk/modelm_ssk.h b/keyboards/converter/modelm_ssk/modelm_ssk.h
new file mode 100644
index 000000000..5c4b9b80e
--- /dev/null
+++ b/keyboards/converter/modelm_ssk/modelm_ssk.h
@@ -0,0 +1,45 @@
1/* Copyright 2019-2021 iw0rm3r, tiltowait
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#pragma once
17
18#include "quantum.h"
19
20/* This a shortcut to help you visually see your layout.
21 * The first section contains "names" for physical keys of the keyboard
22 * and defines their position on the board.
23 * The second section defines position of the keys on the switch matrix
24 * (where COLUMNS and ROWS crosses). */
25
26#define LAYOUT( \
27 K5A, K5B, K5C, K5D, K5E, K5F, K5G, K5H, K5I, K5J, K5K, K5L, K5M, K5N, K5O, K5P, \
28 \
29 K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, K4O, K4P, K4Q, \
30 K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K3N, K3O, K3P, K3Q, \
31 K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2M, K2N, \
32 K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1L, K1M, K1N, \
33 K0A, K0B, K0C, K0D, K0E, K0F, K0G, K0H \
34) \
35{ \
36/* 00 */ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K1G, K0C, K1H, KC_NO, KC_NO, K1L, K0G, K0H, KC_NO, K0F, K0D }, \
37/* 01 */ { K0E, K1M, K1C, K1D, K1E, K1F, K2N, K1I, K1J, K1K, KC_NO, KC_NO, KC_NO, KC_NO, K5P, KC_NO }, \
38/* 02 */ { KC_NO, KC_NO, K2B, K2C, K2D, K2E, K3N, K2H, K2I, K2J, K2K, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
39/* 03 */ { KC_NO, KC_NO, K3B, K3C, K3D, K3E, KC_NO, K3H, K3I, K3J, K3K, KC_NO, KC_NO, KC_NO, KC_NO, K5O }, \
40/* 04 */ { KC_NO, KC_NO, K4B, K4C, K4D, K4E, K5K, K4H, K4I, K4J, K4K, K5L, K5M, K3Q, K3P, K5N }, \
41/* 05 */ { K0A, KC_NO, K4A, K5B, K5C, K4F, K5J, K4G, K4M, K5I, K4L, K3O, K4O, K4Q, K4P, KC_NO }, \
42/* 06 */ { KC_NO, K1A, K3A, K2A, K5D, K3F, K4N, K3G, K3M, K5H, K3L, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
43/* 07 */ { KC_NO, KC_NO, K5A, KC_NO, K5E, K2F, K5F, K2G, K5G, KC_NO, K2L, KC_NO, KC_NO, KC_NO, K1N, K0B }, \
44}
45/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
diff --git a/keyboards/converter/modelm_ssk/readme.md b/keyboards/converter/modelm_ssk/readme.md
new file mode 100644
index 000000000..8105a0c2d
--- /dev/null
+++ b/keyboards/converter/modelm_ssk/readme.md
@@ -0,0 +1,55 @@
1# modelm_ssk
2
3![IBM Model M Space-Saving Keyboard](https://i.imgur.com/CSXrQI5.jpg)
4
5This is a QMK firmware configuration for the IBM Model M Space-Saving Keyboard (SSK). Based on [this project](https://github.com/qmk/qmk_firmware/tree/master/keyboards/converter/modelm101), it features a few slight improvements and, most importantly, a full remapping to match the SSK's matrix, which differs from its full-sized cousins. The modification is easily reversible, as no part of the keyboard is permanently changed. Just take out the replacement controller and reinstall the original, should you desire.
6
7The numpad layer (accessed with Shift + Scroll Lock as with the original controller) is mapped to layer 7 by default. All non-numpad keys are transparent.
8
9**Note:** As of this writing, this configuration has only been tested on the 1392464 SSK. It's possible other models differ in their internal matrices. Should the provided matrix not work for you (and you are certain of your connections), you can enable debugging with `CONSOLE_ENABLE = yes` in `rules.mk` and by following the directions in `default/keymap.c`. Once done, [QMK Toolbox](https://github.com/qmk/qmk_toolbox) will display row/col information to help you remap `modelm_ssk.h`.
10
11## Requirements
12
13* [Teensy++ 2.0](https://www.pjrc.com/store/teensypp.html) - I recommend buying one with pins already attached
14* A Trio-Mate 16-pin ribbon connector (6-520315-6 or 6-520415-6)
15* A Trio-Mate 8-pin ribbon connector (5-120628-8 or 5-520314-8). Alternatively, two 16-pin connectors can be used if the 8-pin is out of stock. Just be sure to line up your pins correctly
16* Breadboard or perfboard. A perfboard is recommended due to its reduced height and low clearance inside the chassis
17* Mini-B to USB-A cable
18* Jumper wires and wire strippers/cutters
19* Soldering iron if not using a breadboard
20
21## Setup
22
23![Finished controller](https://i.imgur.com/m1yuo4F.jpg)
24
25The controller uses the following mapping (in zero-indexed hex):
26
27```
28Column: 0 1 2 3 4 5 6 7 8 9 A B C D E F
29Pin: C7 C6 C5 C4 C3 C2 C1 C0 E1 E0 D7 D5 D4 D3 D2 D1
30--------------------------------------------------------
31Row: 0 1 2 3 4 5 6 7
32Pin: F0 F1 F2 F3 F4 F5 F6 F7
33```
34
35**IMPORTANT:** It is necessary to skip pin D6 on the Teensy. There is an LED attached to this pin, which can cause interference with registering keys. Alternatively, you can remove the LED from the board, which is likely to be a permanent modification of the Teensy. The choice is yours. I am not responsible for any damage to your Teensy or keyboard.
36
37## A note on the Unicomp Mini M
38
39This configuration will not work out of the box with the [Unicomp Mini M](https://www.pckeyboard.com/page/product/MINI_M). That keyboard uses a 16x12 matrix rather than the SSK's 16x8 in order to reduce occurrences of 2KRO lockup. It also features lock lights, which the SSK lacks. However, it should be possible to map out the Mini M's matrix to get it working.
40
41## Maintainer
42
43* Keyboard Maintainer: [tiltowait](https://github.com/tiltowait), original work by [iw0rm3r](https://github.com/iw0rm3r)
44* Hardware Supported: Teensy 2.0++ board by PJRC
45* Hardware Availability: https://www.pjrc.com/store/teensypp.html
46
47## Building
48
49Make example for this keyboard (after setting up your build environment):
50
51 make converter/modelm_ssk:default
52
53You must press the button on the Teensy to enter the bootloader the first time. Afterward, so long as you keep `COMMAND_ENABLE = yes` in `rules.mk` (enabled by default), you can use `Left Shift + Right Shift + B` to enter the bootloader. With this method, you can omit `:teensy` from the end of the `make` command.
54
55See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
diff --git a/keyboards/converter/modelm_ssk/rules.mk b/keyboards/converter/modelm_ssk/rules.mk
new file mode 100644
index 000000000..31dbac78b
--- /dev/null
+++ b/keyboards/converter/modelm_ssk/rules.mk
@@ -0,0 +1,23 @@
1# MCU name
2MCU = at90usb1286
3
4# Bootloader selection
5BOOTLOADER = halfkay
6
7# Build Options
8# change yes to no to disable
9#
10BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration
11MOUSEKEY_ENABLE = no # Mouse keys
12EXTRAKEY_ENABLE = yes # Audio control and System control
13CONSOLE_ENABLE = no # Console for debug
14COMMAND_ENABLE = yes # Commands for debug and configuration
15# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
16SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
17# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
18# Do not enable NKRO_ENABLE. The SSK lacks diodes and cannot support it
19NKRO_ENABLE = no # USB Nkey Rollover
20BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
21RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
22BLUETOOTH_ENABLE = no # Enable Bluetooth
23AUDIO_ENABLE = no # Audio output