aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Ko <chriskopher@gmail.com>2020-04-28 06:10:42 -0400
committerGitHub <noreply@github.com>2020-04-28 03:10:42 -0700
commite1217dae5a659448920a6b0a987f9a2d24ea498c (patch)
tree3960f5b02fa0bcc5290ff698176f26276b785196
parent485a0b0bc358b32ec042793a5195ced2c4cda7df (diff)
downloadqmk_firmware-e1217dae5a659448920a6b0a987f9a2d24ea498c.tar.gz
qmk_firmware-e1217dae5a659448920a6b0a987f9a2d24ea498c.zip
[Keymap] add chriskopher keymap for usb-usb converter (#8856)
-rw-r--r--keyboards/converter/usb_usb/keymaps/chriskopher/combo.c54
-rw-r--r--keyboards/converter/usb_usb/keymaps/chriskopher/config.h25
-rw-r--r--keyboards/converter/usb_usb/keymaps/chriskopher/keymap.c186
-rw-r--r--keyboards/converter/usb_usb/keymaps/chriskopher/readme.md193
-rw-r--r--keyboards/converter/usb_usb/keymaps/chriskopher/rules.mk24
-rw-r--r--keyboards/converter/usb_usb/keymaps/chriskopher/shared_enum.h36
-rw-r--r--keyboards/converter/usb_usb/keymaps/chriskopher/tap_dance.c164
7 files changed, 682 insertions, 0 deletions
diff --git a/keyboards/converter/usb_usb/keymaps/chriskopher/combo.c b/keyboards/converter/usb_usb/keymaps/chriskopher/combo.c
new file mode 100644
index 000000000..c0a354eb5
--- /dev/null
+++ b/keyboards/converter/usb_usb/keymaps/chriskopher/combo.c
@@ -0,0 +1,54 @@
1/* Copyright 2020 Christopher Ko <chriskopher@gmail.com>
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#include "shared_enum.h"
18
19#include "quantum.h"
20
21enum combo_event {
22 SD_LAYER_COMBO,
23 KL_MEH_COMBO,
24};
25
26const uint16_t PROGMEM sd_combo[] = {KC_S, KC_D, COMBO_END}; // Combo: S + D for SuperDuper mode
27const uint16_t PROGMEM kl_combo[] = {KC_K, KC_L, COMBO_END}; // Combo: K + L for Meh modifier
28
29// Register the combo action
30combo_t key_combos[COMBO_COUNT] = {
31 [SD_LAYER_COMBO] = COMBO_ACTION(sd_combo),
32 [KL_MEH_COMBO] = COMBO_ACTION(kl_combo),
33};
34
35// Called after a combo event is triggered
36void process_combo_event(uint8_t combo_index, bool pressed) {
37 switch (combo_index) {
38 case SD_LAYER_COMBO:
39 if (pressed) {
40 layer_on(_SUPERDUPER);
41 } else {
42 layer_off(_SUPERDUPER);
43 }
44 break;
45
46 case KL_MEH_COMBO:
47 if (pressed) {
48 register_mods(MOD_MEH);
49 } else {
50 unregister_mods(MOD_MEH);
51 }
52 break;
53 }
54}
diff --git a/keyboards/converter/usb_usb/keymaps/chriskopher/config.h b/keyboards/converter/usb_usb/keymaps/chriskopher/config.h
new file mode 100644
index 000000000..7714f713b
--- /dev/null
+++ b/keyboards/converter/usb_usb/keymaps/chriskopher/config.h
@@ -0,0 +1,25 @@
1/* Copyright 2020 Christopher Ko <chriskopher@gmail.com>
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#define TAPPING_TERM 200 // Delay for tap modifiers until it is considered a hold
20
21#define IGNORE_MOD_TAP_INTERRUPT // Enable ignore mod tap interrupt: https://docs.qmk.fm/#/tap_hold?id=ignore-mod-tap-interrupt
22#define IGNORE_MOD_TAP_INTERRUPT_PER_KEY // Allows configuration of ignore mod tap interrupt per key in keymap.c
23
24#define COMBO_COUNT 2 // Number of defined combos
25#define COMBO_TERM 20 // Delay for combo keys to be chained together
diff --git a/keyboards/converter/usb_usb/keymaps/chriskopher/keymap.c b/keyboards/converter/usb_usb/keymaps/chriskopher/keymap.c
new file mode 100644
index 000000000..c472f78b7
--- /dev/null
+++ b/keyboards/converter/usb_usb/keymaps/chriskopher/keymap.c
@@ -0,0 +1,186 @@
1/* Copyright 2020 Christopher Ko <chriskopher@gmail.com>
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#include "shared_enum.h"
18
19#include QMK_KEYBOARD_H
20
21// clang-format off
22const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
23 /* Modified Qwerty for chriskopher: base default layer
24 * ,---. ,---------------. ,---------------. ,---------------. ,-----------.
25 * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau|
26 * `---' `---------------' `---------------' `---------------' `-----------'
27 * ,-----------------------------------------------------------. ,-----------. ,---------------.
28 * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \ | |Ins|Hom|PgU| |NmL| /| *| -|
29 * |-----------------------------------------------------------| |-----------| |---------------|
30 * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| Bsp| |Del|End|PgD| | 7| 8| 9| |
31 * |-----------------------------------------------------------| `-----------' |-----------| |
32 * |Ctl/Esc| A| S| D| F| G| H| J| K| L|;/:| ' | Return| | 4| 5| 6| +|
33 * |-----------------------------------------------------------| ,---. |---------------|
34 * |Shift/( |Dev/Z| X| C| V| B| N| M| ,| .| /| Shift/)| | ↑ | | 1| 2| 3| |
35 * |-----------------------------------------------------------| ,-----------. |-----------| |
36 * |Meh/CapsL|Gui|Alt| Space |Alt|Adjust/Gui|App| Ctl| | ← | ↓ | → | | 0| .|Ent|
37 * `-----------------------------------------------------------' `-----------' `---------------'
38 */
39 [_CKO] = LAYOUT_ansi(
40 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, KC_SLCK, KC_PAUS,
41 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, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,
42 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, KC_P7, KC_P8, KC_P9,
43 LCTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, TD(SCLN_CLN), KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS,
44 TD(ESPC_L), LT(_DEV,KC_Z), KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, TD(ESPC_R), KC_UP, KC_P1, KC_P2, KC_P3,
45 MEH_T(KC_CAPS), KC_LGUI, KC_LALT, KC_SPC, KC_RALT, LT(_ADJUST,KC_RGUI), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT
46 ),
47
48 /* Regular Qwerty: default layer
49 * ,---. ,---------------. ,---------------. ,---------------. ,-----------.
50 * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau|
51 * `---' `---------------' `---------------' `---------------' `-----------'
52 * ,-----------------------------------------------------------. ,-----------. ,---------------.
53 * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| Bsp| |Ins|Hom|PgU| |NmL| /| *| -|
54 * |-----------------------------------------------------------| |-----------| |---------------|
55 * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | |Del|End|PgD| | 7| 8| 9| |
56 * |-----------------------------------------------------------| `-----------' |-----------| |
57 * |CapsL | A| S| D| F| G| H| J| K| L| ;| '| Return| | 4| 5| 6| +|
58 * |-----------------------------------------------------------| ,---. |---------------|
59 * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shift | | ↑ | | 1| 2| 3| |
60 * |-----------------------------------------------------------| ,-----------. |-----------| |
61 * |Ctl|Gui|Alt| Space |Alt|Adjust/Gui|App|Ctl| | ← | ↓ | → | | 0| .|Ent|
62 * `-----------------------------------------------------------' `-----------' `---------------'
63 */
64 [_QWERTY] = LAYOUT_ansi(
65 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, KC_SLCK, KC_PAUS,
66 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, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,
67 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, KC_P7, KC_P8, KC_P9,
68 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_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS,
69 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3,
70 KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, LT(_ADJUST,KC_RGUI), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT
71 ),
72
73 /* SuperDuper
74 * ,---. ,---------------. ,---------------. ,---------------. ,-----------.
75 * | | | | | | | | | | | | | | | | | | | | |
76 * `---' `---------------' `---------------' `---------------' `-----------'
77 * ,-----------------------------------------------------------. ,-----------. ,---------------.
78 * | | | | | | | | | | | | | | | | | | | | | | | |
79 * |-----------------------------------------------------------| |-----------| |---------------|
80 * | | | | | | | |1T |T← |T→ |9T | | | | | | | | | | | | |
81 * |-----------------------------------------------------------| `-----------' |-----------| |
82 * | |Alt|[SuperDuper]|Bksp|Ctl| ← | ↓ | ↑ | → |Del| | | | | | | |
83 * |-----------------------------------------------------------| ,---. |---------------|
84 * | | | | | | | | | | |ToggleSD| | | | | | | | |
85 * |-----------------------------------------------------------| ,-----------. |-----------| |
86 * | | | | Shift | | | | | | | | | | | | |
87 * `-----------------------------------------------------------' `-----------' `---------------'
88 */
89 [_SUPERDUPER] = LAYOUT_ansi(
90 ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______,
91 ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______,
92 ______, ______, ______, ______, ______, ______, ______, C(KC_1), C(S(KC_TAB)), C(KC_TAB), C(KC_9), ______, ______, ______, ______, ______, ______, ______, ______, ______,
93 ______, KC_LALT, ______, ______, KC_BSPC, KC_LCTL, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_DEL, ______, ______, ______, ______, ______, ______,
94 ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, TG(_SUPERDUPER), ______, ______, ______, ______, ______,
95 ______, ______, ______, KC_LSFT, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______
96 ),
97
98 /* Dev
99 * ,---. ,---------------. ,---------------. ,---------------. ,-----------.
100 * | | | | | | | | | | | | | | | | | | | | |
101 * `---' `---------------' `---------------' `---------------' `-----------'
102 * ,-----------------------------------------------------------. ,-----------. ,---------------.
103 * | | | | | | | | | | | | | | | | | | | | | | | |
104 * |-----------------------------------------------------------| |-----------| |---------------|
105 * | | | | | | | | - | + | ( | ) | | | | | | | | | | | | |
106 * |-----------------------------------------------------------| `-----------' |-----------| |
107 * | | | | | | | _ | [ | ] | { | } | | | | | | | |
108 * |-----------------------------------------------------------| ,---. |---------------|
109 * | | | | | | | = | | | < | > | ? | | | | | | | | |
110 * |-----------------------------------------------------------| ,-----------. |-----------| |
111 * | | | | | | | | | | | | | | | | |
112 * `-----------------------------------------------------------' `-----------' `---------------'
113 */
114 [_DEV] = LAYOUT_ansi(
115 ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______,
116 ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______,
117 ______, ______, ______, ______, ______, ______, ______, KC_MINS, S(KC_EQL), S(KC_9), S(KC_0), ______, ______, ______, ______, ______, ______, ______, ______, ______,
118 ______, ______, ______, ______, ______, ______, S(KC_MINS), KC_LBRC, KC_RBRC, S(KC_LBRC), S(KC_RBRC), ______, ______, ______, ______, ______, ______,
119 ______, ______, ______, ______, ______, ______, KC_EQL, S(KC_BSLASH), S(KC_COMM), S(KC_DOT), S(KC_SLSH), ______, ______, ______, ______, ______,
120 ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______
121 ),
122
123 /* Adjust
124 * ,---. ,---------------. ,---------------. ,---------------. ,-----------.
125 * | | | | | | | | | | | | | | | | | | | | |
126 * `---' `---------------' `---------------' `---------------' `-----------'
127 * ,-----------------------------------------------------------. ,--------------. ,---------------.
128 * | | | | | | | | | | | | | | | |Play|Next|VolU| | | | | |
129 * |-----------------------------------------------------------| |--------------| |---------------|
130 * | |QWERTY| | | | | | | | | | | | | |Stop|Prev|VolD| | | | | |
131 * |-----------------------------------------------------------| `--------------' |-----------| |
132 * | | | | | | | | | | | | | | | | | | |
133 * |-----------------------------------------------------------| ,---. |---------------|
134 * | | | |CKO| | | |Play|Mute|VolD|VolU| SD| | | | | | | | |
135 * |-----------------------------------------------------------| ,-----------. |-----------| |
136 * | | | | | | | | | | | | | | | | |
137 * `-----------------------------------------------------------' `-----------' `---------------'
138 */
139 [_ADJUST] = LAYOUT_ansi(
140 ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______,
141 ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_MPLY, KC_MNXT, KC_VOLU, ______, ______, ______, ______,
142 ______, DF(_QWERTY), ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_MSTP, KC_MPRV, KC_VOLD, ______, ______, ______,
143 ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______,
144 ______, ______, ______, DF(_CKO), ______, ______, KC_MPLY, KC_MUTE, KC_VOLD, KC_VOLU, TG(_SUPERDUPER), ______, ______, ______, ______, ______,
145 ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______
146 )
147
148/* Empty layout for future reference
149 * ,---. ,---------------. ,---------------. ,---------------. ,-----------.
150 * | | | | | | | | | | | | | | | | | | | | |
151 * `---' `---------------' `---------------' `---------------' `-----------'
152 * ,-----------------------------------------------------------. ,-----------. ,---------------.
153 * | | | | | | | | | | | | | | | | | | | | | | | |
154 * |-----------------------------------------------------------| |-----------| |---------------|
155 * | | | | | | | | | | | | | | | | | | | | | | | |
156 * |-----------------------------------------------------------| `-----------' |-----------| |
157 * | | | | | | | | | | | | | | | | | | |
158 * |-----------------------------------------------------------| ,---. |---------------|
159 * | | | | | | | | | | | | | | | | | | | |
160 * |-----------------------------------------------------------| ,-----------. |-----------| |
161 * | | | | | | | | | | | | | | | | |
162 * `-----------------------------------------------------------' `-----------' `---------------'
163 */
164 /*
165 * [_EMPTY] = LAYOUT_ansi(
166 * ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______,
167 * ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______,
168 * ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______,
169 * ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______,
170 * ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______,
171 * ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______
172 * ),
173 */
174};
175// clang-format on
176
177// Configure ignore mod tap interrupt per key
178bool get_ignore_mod_tap_interrupt(uint16_t keycode) {
179 switch (keycode) {
180 // I don't like how mod tap interrupt feels with these keys specifically when I'm typing
181 case LCTL_T(KC_ESC):
182 return false;
183 default:
184 return true;
185 }
186}
diff --git a/keyboards/converter/usb_usb/keymaps/chriskopher/readme.md b/keyboards/converter/usb_usb/keymaps/chriskopher/readme.md
new file mode 100644
index 000000000..59f70716a
--- /dev/null
+++ b/keyboards/converter/usb_usb/keymaps/chriskopher/readme.md
@@ -0,0 +1,193 @@
1# chriskopher's QMK Config
2Currently designed for the use of an ANSI tenkeyless keyboard on Windows 10. Although many of the ideas can be applied agnostically across operating systems.
3
4## Hardware
5- [Hasu USB to USB Controller Converter](https://www.1upkeyboards.com/shop/controllers/usb-to-usb-converter/)
6 - Limitations include:
7 - 6KRO
8 - Media/System control keys and <kbd>Fn</kbd> key are not recognized by the converter
9 - Max firmware size of 28K and a lot of it is taken up by the USB keyboard support, so not all QMK features can be enabled
10 - No mouse or other pointing device support
11- A regular ANSI QWERTY USB Type B keyboard
12
13## Layer Overview
14### Base Layers
15#### 0. [My personal modified QWERTY layout](#chriskopher-qwerty-layout)
16This is the default base layer that is used for most of my typing and where the intermediate layers are stacked onto. It is loaded by default on keyboard power up.
17- Apply this base layer with <kbd>[Adjust](#adjust-layer)</kbd> + <kbd>c</kbd>, or by powering on the keyboard
18- Swapped <kbd>CapsLock</kbd> and <kbd>LCtrl</kbd> for ergonomics with often performed <kbd>LCtrl</kbd> keyboard shortcuts
19- Swapped <kbd>\\</kbd> and <kbd>Backspace</kbd> to minimize hand movement, inspired by the [HHKB](https://happyhackingkb.com/) layout
20- Overloaded modifier keys, inspired by Steve Losh's [A Modern Space Cadet](https://stevelosh.com/blog/2012/10/a-modern-space-cadet/)
21 - Tap <kbd>LShift</kbd> for <kbd>(</kbd>, hold for <kbd>LShift</kbd>
22 - Tap <kbd>RShift</kbd> for <kbd>)</kbd>, hold for <kbd>RShift</kbd>
23 - Tap <kbd>LCtrl</kbd> for <kbd>Esc</kbd>, hold for <kbd>LCtrl</kbd> (remember that <kbd>LCtrl</kbd> is swapped with <kbd>CapsLock</kbd>)
24- Tap Dances that allow different functionality based on the number of key presses within the `TAPPING_TERM` of 200 ms
25 - Extended space cadet shifting:
26 - Two taps of <kbd>LShift</kbd> sends <kbd>{</kbd>, and three taps send <kbd>[</kbd>
27 - Two taps of <kbd>RShift</kbd> sends <kbd>}</kbd>, and three taps send <kbd>]</kbd>
28 - One tap of <kbd>;</kbd> will send <kbd>;</kbd>, two taps of <kbd>;</kbd> will send <kbd>:</kbd>
29- Combos that allow for different functionality based on custom chorded key presses within the `COMBO_TERM` of 20 ms
30 - Press and hold <kbd>s</kbd> and <kbd>d</kbd> to momentarily activate the <kbd>[(S)uper(D)uper](#superduper-layer)</kbd> layer
31 - Press and hold <kbd>k</kbd> and <kbd>l</kbd> to momentarily activate <kbd>Meh</kbd> modifier key
32 - <kbd>Meh</kbd> key (<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Alt</kbd>) is useful for binding unique hotkeys on the OS that won't collide with or override other existing hotkeys
33 - Tap <kbd>CapsLock</kbd> for <kbd>CapsLock</kbd>, hold <kbd>CapsLock</kbd> to momentarily activate <kbd>Meh</kbd> modifier key while held (remember that <kbd>LCtrl</kbd> is swapped with <kbd>CapsLock</kbd>)
34- Tap/Hold actions for layer switching
35 - Similar to the overloaded modifier keys
36 - Tap <kbd>z</kbd> for <kbd>z</kbd>, hold <kbd>z</kbd> to momentarily activate <kbd>[Dev](#dev-layer)</kbd> layer while held
37 - Tap <kbd>RGui</kbd> for <kbd>RGui</kbd>, hold <kbd>RGui</kbd> to momentarily activate <kbd>[Adjust](#adjust-layer)</kbd> layer while held
38
39```
40,---. ,---------------. ,---------------. ,---------------. ,-----------.
41|Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau|
42`---' `---------------' `---------------' `---------------' `-----------'
43,-----------------------------------------------------------. ,-----------. ,---------------.
44| `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \ | |Ins|Hom|PgU| |NmL| /| *| -|
45|-----------------------------------------------------------| |-----------| |---------------|
46|Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| Bsp| |Del|End|PgD| | 7| 8| 9| |
47|-----------------------------------------------------------| `-----------' |-----------| |
48|Ctl/Esc| A| S| D| F| G| H| J| K| L|;/:| ' | Return| | 4| 5| 6| +|
49|-----------------------------------------------------------| ,---. |---------------|
50|Shift/( |Dev/Z| X| C| V| B| N| M| ,| .| /| Shift/)| | ↑ | | 1| 2| 3| |
51|-----------------------------------------------------------| ,-----------. |-----------| |
52|Meh/CapsL|Gui|Alt| Space |Alt|Adjust/Gui|App| Ctl| | ← | ↓ | → | | 0| .|Ent|
53`-----------------------------------------------------------' `-----------' `---------------'
54```
55
56Note: can't use <kbd>Hyper</kbd> key (<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Alt</kbd> + <kbd>Gui</kbd>) instead of <kbd>Meh</kbd> reliably on Windows 10 because pressing <kbd>Hyper</kbd> opens Microsoft Office, <kbd>Hyper</kbd> + <kbd>t</kbd> opens Microsoft Teams, <kbd>Hyper</kbd> + <kbd>d</kbd> opens Microsoft OneDrive, <kbd>Hyper</kbd> + <kbd>y</kbd> Yammer, etc. And I couldn't find a clean way to disable this without needing to modify the host computer.
57
58#### 1. [A regular QWERTY layout](#regular-qwerty-layout)
59This layer is for when other people need to type on my keyboard.
60- Apply this base layer with <kbd>[Adjust](#adjust-layer)</kbd> + <kbd>q</kbd>
61- The only modification is the addition of the tap/hold action for switching back to the <kbd>[Adjust](#adjust-layer)</kbd> layer while held
62 - Tap <kbd>RGui</kbd> for <kbd>RGui</kbd>, hold <kbd>RGui</kbd> to momentarily activate <kbd>[Adjust](#adjust-layer)</kbd> layer while held
63
64```
65,---. ,---------------. ,---------------. ,---------------. ,-----------.
66|Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau|
67`---' `---------------' `---------------' `---------------' `-----------'
68,-----------------------------------------------------------. ,-----------. ,---------------.
69| `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| Bsp| |Ins|Hom|PgU| |NmL| /| *| -|
70|-----------------------------------------------------------| |-----------| |---------------|
71|Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | |Del|End|PgD| | 7| 8| 9| |
72|-----------------------------------------------------------| `-----------' |-----------| |
73|CapsL | A| S| D| F| G| H| J| K| L| ;| '| Return| | 4| 5| 6| +|
74|-----------------------------------------------------------| ,---. |---------------|
75|Shift | Z| X| C| V| B| N| M| ,| ,| /|Shift | | ↑ | | 1| 2| 3| |
76|-----------------------------------------------------------| ,-----------. |-----------| |
77|Ctl|Gui|Alt| Space |Alt|Adjust/Gui|App|Ctl| | ← | ↓ | → | | 0| .|Ent|
78`-----------------------------------------------------------' `-----------' `---------------'
79```
80
81### Intermediate Layers
82#### 2. [(S)uper(D)uper Mode](#superduper-layer)
83Inspired by [narze](https://github.com/qmk/qmk_firmware/tree/master/keyboards/planck/keymaps/narze) via [jasonrudolph](https://github.com/jasonrudolph/keyboard#super-duper-mode). It's designed to help with navigation while keeping you on the home row, or very close to it.
84
85- To activate this layer, press <kbd>s</kbd> + <kbd>d</kbd> simultaneously and hold from the base layer
86 - Alternatively, hold <kbd>/</kbd> to activate the layer. This method is slower because the layer toggle uses a `TAPPING_TERM` of 200 ms but <kbd>s</kbd> + <kbd>d</kbd> uses a `COMBO_TERM` of only 20 ms (can be changed within `config.h`).
87- Use <kbd>h</kbd> / <kbd>j</kbd> / <kbd>k</kbd> / <kbd>l</kbd>
88 for <kbd>←</kbd> / <kbd>↓</kbd> / <kbd>↑</kbd> / <kbd>→</kbd>, respectively
89- Use <kbd>a</kbd> for <kbd>Alt</kbd>
90- Use <kbd>f</kbd> for <kbd>Backspace</kbd>
91- Use <kbd>g</kbd> for <kbd>Ctrl</kbd>
92- Use <kbd>Space</kbd> for <kbd>Shift</kbd>
93- Use <kbd>;</kbd> for <kbd>Delete</kbd>
94- Use <kbd>i</kbd> / <kbd>o</kbd> to move to the previous/next tab
95- Use <kbd>u</kbd> / <kbd>p</kbd> to go to the first/last tab (in most apps)
96- Use <kbd>/</kbd> to toggle <kbd>[(S)uper(D)uper](#superduper-layer)</kbd> layer
97
98```
99,---. ,---------------. ,---------------. ,---------------. ,-----------.
100| | | | | | | | | | | | | | | | | | | | |
101`---' `---------------' `---------------' `---------------' `-----------'
102,-----------------------------------------------------------. ,-----------. ,---------------.
103| | | | | | | | | | | | | | | | | | | | | | | |
104|-----------------------------------------------------------| |-----------| |---------------|
105| | | | | | | |1T |T← |T→ |9T | | | | | | | | | | | | |
106|-----------------------------------------------------------| `-----------' |-----------| |
107| |Alt|[SuperDuper]|Bksp|Ctl| ← | ↓ | ↑ | → |Del| | | | | | | |
108|-----------------------------------------------------------| ,---. |---------------|
109| | | | | | | | | | |ToggleSD| | | | | | | | |
110|-----------------------------------------------------------| ,-----------. |-----------| |
111| | | | Shift | | | | | | | | | | | | |
112`-----------------------------------------------------------' `-----------' `---------------'
113```
114
115#### 3. [Dev](#dev-layer)
116This layer is for easy access to symbols commonly used during development.
117- To activate this layer, press and hold <kbd>z</kbd> from the base layer
118- Use <kbd>u</kbd> / <kbd>i</kbd> / <kbd>o</kbd> / <kbd>p</kbd>
119 for <kbd>-</kbd> / <kbd>+</kbd> / <kbd>(</kbd> / <kbd>)</kbd>, respectively
120- Use <kbd>h</kbd> / <kbd>j</kbd> / <kbd>k</kbd> / <kbd>l</kbd> / <kbd>;</kbd>
121 for <kbd>_</kbd> / <kbd>[</kbd> / <kbd>]</kbd> / <kbd>{</kbd> / <kbd>}</kbd>, respectively
122- Use <kbd>n</kbd> / <kbd>m</kbd> / <kbd>,</kbd> / <kbd>.</kbd> / <kbd>/</kbd>
123 for <kbd>=</kbd> / <kbd>|</kbd> / <kbd><</kbd> / <kbd>></kbd> / <kbd>?</kbd>, respectively
124
125```
126,---. ,---------------. ,---------------. ,---------------. ,-----------.
127| | | | | | | | | | | | | | | | | | | | |
128`---' `---------------' `---------------' `---------------' `-----------'
129,-----------------------------------------------------------. ,-----------. ,---------------.
130| | | | | | | | | | | | | | | | | | | | | | | |
131|-----------------------------------------------------------| |-----------| |---------------|
132| | | | | | | | - | + | ( | ) | | | | | | | | | | | | |
133|-----------------------------------------------------------| `-----------' |-----------| |
134| | | | | | | _ | [ | ] | { | } | | | | | | | |
135|-----------------------------------------------------------| ,---. |---------------|
136| | | | | | | = | | | < | > | ? | | | | | | | | |
137|-----------------------------------------------------------| ,-----------. |-----------| |
138| | | | | | | | | | | | | | | | |
139`-----------------------------------------------------------' `-----------' `---------------'
140```
141
142### Top Layer
143#### 4. [Adjust](#adjust-layer)
144This layer is applied at the top so that it will override all other layers and as a result it will always be possible to change which base layer is applied as a default. It is also used for media controls.
145- To activate this layer, press and hold <kbd>RGui</kbd> from the base layer
146- Switch to [chriskopher modified QWERTY layout](#chriskopher-qwerty-layout) with <kbd>c</kbd>
147- Switch to [regular QWERTY layout](#regular-qwerty-layout) with <kbd>q</kbd>
148- Use <kbd>n</kbd> / <kbd>m</kbd> / <kbd>,</kbd> / <kbd>.</kbd> / <kbd>/</kbd>
149 for <kbd>Play/Pause</kbd> / <kbd>Mute</kbd> / <kbd>Volume Down</kbd> / <kbd>Volume Up</kbd> / Toggle <kbd>[(S)uper(D)uper](#superduper-layer)</kbd> layer, respectively
150- Use <kbd>Insert</kbd> / <kbd>Home</kbd> / <kbd>Page Up</kbd>
151 for <kbd>Play/Pause</kbd> / <kbd>Next Track</kbd> / <kbd>Volume Up</kbd>, respectively
152- Use <kbd>Delete</kbd> / <kbd>End</kbd> / <kbd>Page Down</kbd>
153for <kbd>Stop</kbd> / <kbd>Previous Track</kbd> / <kbd>Volume Down</kbd>, respectively
154
155```
156,---. ,---------------. ,---------------. ,---------------. ,-----------.
157| | | | | | | | | | | | | | | | | | | | |
158`---' `---------------' `---------------' `---------------' `-----------'
159,-----------------------------------------------------------. ,--------------. ,---------------.
160| | | | | | | | | | | | | | | |Play|Next|VolU| | | | | |
161|-----------------------------------------------------------| |--------------| |---------------|
162| |QWERTY| | | | | | | | | | | | | |Stop|Prev|VolD| | | | | |
163|-----------------------------------------------------------| `--------------' |-----------| |
164| | | | | | | | | | | | | | | | | | |
165|-----------------------------------------------------------| ,---. |---------------|
166| | | |CKO| | | |Play|Mute|VolD|VolU| SD| | | | | | | | |
167|-----------------------------------------------------------| ,-----------. |-----------| |
168| | | | | | | | | | | | | | | | |
169`-----------------------------------------------------------' `-----------' `---------------'
170```
171
172## Build Instructions
173To compile and flash the config onto the USB to USB converter:
174```sh
175cd /path/to/qmk_firmware
176qmk config user.keyboard=converter/usb_usb/hasu
177qmk config user.keymap=chriskopher
178qmk compile
179qmk flash
180```
181
182Alternatively:
183```sh
184cd /path/to/qmk_firmware
185qmk compile -kb converter/usb_usb/hasu -km chriskopher
186qmk flash -kb converter/usb_usb/hasu -km chriskopher
187```
188
189To modify the config:
190```sh
191cd /path/to/qmk_firmware/keyboards/converter/usb_usb/keymaps/chriskopher
192```
193and edit `keymap.c`, `config.h`, and `rules.mk`.
diff --git a/keyboards/converter/usb_usb/keymaps/chriskopher/rules.mk b/keyboards/converter/usb_usb/keymaps/chriskopher/rules.mk
new file mode 100644
index 000000000..d80022853
--- /dev/null
+++ b/keyboards/converter/usb_usb/keymaps/chriskopher/rules.mk
@@ -0,0 +1,24 @@
1# Copyright 2020 Christopher Ko <chriskopher@gmail.com>
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
16COMMAND_ENABLE = no # Not being used, and can cause conflicts with space cadet shifting
17SPACE_CADET_ENABLE = no # Not using special built in space cadet keys, using custom tap dance instead
18EXTRAKEY_ENABLE = yes # Used for audio control and system control keys
19COMBO_ENABLE = yes # Used to allow chording of keys to trigger an action
20TAP_DANCE_ENABLE = yes # Used to allow multiple taps of a key to perform different actions
21
22LINK_TIME_OPTIMIZATION_ENABLE = yes # Reduces the compiled firmware size
23
24SRC += combo.c tap_dance.c
diff --git a/keyboards/converter/usb_usb/keymaps/chriskopher/shared_enum.h b/keyboards/converter/usb_usb/keymaps/chriskopher/shared_enum.h
new file mode 100644
index 000000000..f83bfa3c4
--- /dev/null
+++ b/keyboards/converter/usb_usb/keymaps/chriskopher/shared_enum.h
@@ -0,0 +1,36 @@
1/* Copyright 2020 Christopher Ko <chriskopher@gmail.com>
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
19enum keyboard_layer {
20 // Base layers
21 _CKO,
22 _QWERTY,
23 // Intermediate layers
24 _SUPERDUPER,
25 _DEV,
26 // Adjust layer at the end
27 _ADJUST
28};
29
30enum tap_dance_key_event {
31 // Extended space cadet shift tap dance
32 ESPC_L,
33 ESPC_R,
34 // Semicolon-Colon tap dance
35 SCLN_CLN
36};
diff --git a/keyboards/converter/usb_usb/keymaps/chriskopher/tap_dance.c b/keyboards/converter/usb_usb/keymaps/chriskopher/tap_dance.c
new file mode 100644
index 000000000..8600d8399
--- /dev/null
+++ b/keyboards/converter/usb_usb/keymaps/chriskopher/tap_dance.c
@@ -0,0 +1,164 @@
1/* Copyright 2020 Christopher Ko <chriskopher@gmail.com>
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#include "shared_enum.h"
18
19#include "quantum.h"
20
21enum tap_dance_state {
22 SINGLE_HOLD = 1,
23 SINGLE_TAP,
24 DOUBLE_TAP,
25 TRIPLE_TAP,
26};
27
28// Record current state of a tap dance
29static int espc_l_tap_state = 0;
30static int espc_r_tap_state = 0;
31static int scln_cln_tap_state = 0;
32
33// Watch the state of the tap dance
34int cur_dance(qk_tap_dance_state_t *state) {
35 if (state->pressed) {
36 return SINGLE_HOLD;
37 }
38 if (state->count == 1) {
39 return SINGLE_TAP;
40 }
41 if (state->count == 2) {
42 return DOUBLE_TAP;
43 }
44 if (state->count == 3) {
45 return TRIPLE_TAP;
46 }
47
48 return -1;
49}
50
51// Extended Space Cadet Shift - Left ==================================
52void espc_l_finished(qk_tap_dance_state_t *state, void *user_data) {
53 espc_l_tap_state = cur_dance(state);
54 switch (espc_l_tap_state) {
55 case SINGLE_TAP: // (
56 register_code16(LSFT(KC_9));
57 break;
58 case DOUBLE_TAP: // {
59 unregister_code16(LSFT(KC_9));
60 register_code16(LSFT(KC_LBRC));
61 break;
62 case TRIPLE_TAP: // [
63 unregister_code16(LSFT(KC_LBRC));
64 register_code16(KC_LBRC);
65 break;
66 case SINGLE_HOLD: // LShift
67 register_code16(KC_LSFT);
68 break;
69 }
70}
71
72void espc_l_reset(qk_tap_dance_state_t *state, void *user_data) {
73 switch (espc_l_tap_state) {
74 case SINGLE_TAP: // (
75 unregister_code16(LSFT(KC_9));
76 break;
77 case DOUBLE_TAP: // {
78 unregister_code16(LSFT(KC_LBRC));
79 break;
80 case TRIPLE_TAP: // [
81 unregister_code16(KC_LBRC);
82 break;
83 case SINGLE_HOLD: // LShift
84 unregister_code16(KC_LSFT);
85 break;
86 }
87 espc_l_tap_state = 0;
88}
89// ====================================================================//
90
91// Extended Space Cadet Shift - Right ==================================
92void espc_r_finished(qk_tap_dance_state_t *state, void *user_data) {
93 espc_r_tap_state = cur_dance(state);
94 switch (espc_r_tap_state) {
95 case SINGLE_TAP: // )
96 register_code16(LSFT(KC_0));
97 break;
98 case DOUBLE_TAP: // }
99 unregister_code16(LSFT(KC_0));
100 register_code16(LSFT(KC_RBRC));
101 break;
102 case TRIPLE_TAP: // ]
103 unregister_code16(LSFT(KC_RBRC));
104 register_code16(KC_RBRC);
105 break;
106 case SINGLE_HOLD: // RShift
107 register_code16(KC_RSFT);
108 break;
109 }
110}
111
112void espc_r_reset(qk_tap_dance_state_t *state, void *user_data) {
113 switch (espc_r_tap_state) {
114 case SINGLE_TAP: // )
115 unregister_code16(LSFT(KC_0));
116 break;
117 case DOUBLE_TAP: // }
118 unregister_code16(LSFT(KC_RBRC));
119 break;
120 case TRIPLE_TAP: // ]
121 unregister_code16(KC_RBRC);
122 break;
123 case SINGLE_HOLD: // RShift
124 unregister_code16(KC_RSFT);
125 break;
126 }
127 espc_r_tap_state = 0;
128}
129// ====================================================================//
130
131// Semicolon - Colon ==================================================
132void scln_cln_finished(qk_tap_dance_state_t *state, void *user_data) {
133 scln_cln_tap_state = cur_dance(state);
134 switch (scln_cln_tap_state) {
135 case SINGLE_TAP: // ;
136 register_code16(KC_SCLN);
137 break;
138 default: // :
139 register_code16(LSFT(KC_SCLN));
140 break;
141 }
142}
143
144void scln_cln_reset(qk_tap_dance_state_t *state, void *user_data) {
145 switch (scln_cln_tap_state) {
146 case SINGLE_TAP: // ;
147 unregister_code16(KC_SCLN);
148 break;
149 default: // :
150 unregister_code16(LSFT(KC_SCLN));
151 break;
152 }
153}
154// ====================================================================//
155
156// Associate tap dance with defined functionality
157qk_tap_dance_action_t tap_dance_actions[] = {
158 // Extended space cadet shift left: Hold - Shift, One - (, Two - {, Three - [
159 [ESPC_L] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, espc_l_finished, espc_l_reset),
160 // Extended space cadet shift right: Hold - Shift, One - ), Two - }, Three - ]
161 [ESPC_R] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, espc_r_finished, espc_r_reset),
162 // Semicolon - Colon: One - ;, Two - :
163 [SCLN_CLN] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, scln_cln_finished, scln_cln_reset),
164};