aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/kbd6x/keymaps/othi/config.h10
-rw-r--r--keyboards/kbd6x/keymaps/othi/keymap.c190
-rw-r--r--keyboards/kbd6x/keymaps/othi/readme.md56
-rw-r--r--keyboards/kbd6x/keymaps/othi/rules.mk19
4 files changed, 275 insertions, 0 deletions
diff --git a/keyboards/kbd6x/keymaps/othi/config.h b/keyboards/kbd6x/keymaps/othi/config.h
new file mode 100644
index 000000000..42f68b435
--- /dev/null
+++ b/keyboards/kbd6x/keymaps/othi/config.h
@@ -0,0 +1,10 @@
1#pragma once
2#define ONESHOT_TAP_TOOGLE 2
3#define ONESHOT_TIMEOUT 2000
4// tap dance configurations
5#define TAPPING_TERM 200
6#define TAPPING_TOGGLE 2
7#define PERMISSIVE_HOLD
8// Fix KC_GESC conflict with Cmd+Alt+Esc on macros
9#define GRAVE_ESC_GUI_OVERRIDE
10
diff --git a/keyboards/kbd6x/keymaps/othi/keymap.c b/keyboards/kbd6x/keymaps/othi/keymap.c
new file mode 100644
index 000000000..1e0fc8ad7
--- /dev/null
+++ b/keyboards/kbd6x/keymaps/othi/keymap.c
@@ -0,0 +1,190 @@
1/* Copyright 2018 Othi
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
18// read README.md for rundown of what does what
19
20// #define BL 0
21#define CL 0
22#define NM_MODE 2
23#define VI_MODE 3
24#define FN3 4
25#define ACCENT 5
26#define ACCENT_CAP 6
27
28//Unicode keymaps
29void eeconfig_init_user(void) {
30 set_unicode_input_mode(UC_LNX);
31}
32#define DE_AE UC(0x00E4)
33#define DE_SS UC(0x00DF)
34#define DE_OE UC(0x00F6)
35#define DE_UE UC(0x00FC)
36#define DE_AE_CAP UC(0x00C4)
37#define DE_OE_CAP UC(0x00D6)
38#define DE_UE_CAP UC(0x00DC)
39
40uint32_t layer_state_set_user(uint32_t state) {
41 switch (biton32(state)) {
42 case NM_MODE:
43 rgblight_setrgb (0x00, 0x66, 0x00);
44 break;
45 case VI_MODE:
46 rgblight_setrgb (0x66, 0x66, 0x00);
47 break;
48 case ACCENT:
49 rgblight_setrgb (0x7A, 0x00, 0xFF);
50 break;
51 case ACCENT_CAP:
52 rgblight_setrgb (0x7A, 0xFF, 0xFF);
53 break;
54 default: // for any other layers, or the default layer
55 rgblight_setrgb (0xFF, 0x00, 0x00);
56 break;
57 }
58 return state;
59}
60
61//Tap Dance Declarations
62enum {
63 CTL_NM = 0,
64 ALT_NM = 1,
65 SFT_NM = 2,
66 GUI_NM = 3
67};
68
69void dance_CTL_NM_finished (qk_tap_dance_state_t *state, void *user_data) {
70 if (state->count == 1) {
71 set_oneshot_mods(MOD_LCTL);
72 } else {
73 register_code (KC_LCTL);
74 layer_on(NM_MODE);
75 }
76}
77
78void dance_CTL_NM_reset (qk_tap_dance_state_t *state, void *user_data) {
79 if (state->count == 1) {
80 unregister_code (KC_LCTL);
81 } else {
82 unregister_code (KC_LCTL);
83 layer_off(NM_MODE);
84 }
85}
86
87void dance_GUI_NM_finished (qk_tap_dance_state_t *state, void *user_data) {
88 if (state->count == 1) {
89 register_code (KC_LGUI);
90 } else {
91 register_code (KC_LGUI);
92 layer_on(NM_MODE);
93 }
94}
95
96void dance_GUI_NM_reset (qk_tap_dance_state_t *state, void *user_data) {
97 if (state->count == 1) {
98 unregister_code (KC_LGUI);
99 } else {
100 unregister_code (KC_LGUI);
101 layer_off(NM_MODE);
102 }
103}
104
105void dance_ALT_NM_finished (qk_tap_dance_state_t *state, void *user_data) {
106 if (state->count == 1) {
107 register_code (KC_LALT);
108 } else {
109 register_code (KC_LALT);
110 layer_on(NM_MODE);
111 }
112}
113
114void dance_ALT_NM_reset (qk_tap_dance_state_t *state, void *user_data) {
115 if (state->count == 1) {
116 unregister_code (KC_LALT);
117 } else {
118 unregister_code (KC_LALT);
119 layer_off(NM_MODE);
120 }
121}
122
123void dance_SFT_NM_finished (qk_tap_dance_state_t *state, void *user_data) {
124 if (state->count == 1) {
125 register_code (KC_LSFT);
126 set_oneshot_mods(MOD_LSFT);
127 } else {
128 register_code (KC_LSFT);
129 layer_on(NM_MODE);
130 }
131}
132
133void dance_SFT_NM_reset (qk_tap_dance_state_t *state, void *user_data) {
134 if (state->count == 1) {
135 unregister_code (KC_LSFT);
136 } else {
137 unregister_code (KC_LSFT);
138 layer_off(NM_MODE);
139 }
140}
141
142
143qk_tap_dance_action_t tap_dance_actions[] = {
144 [CTL_NM] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, dance_CTL_NM_finished, dance_CTL_NM_reset),
145 [GUI_NM] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, dance_GUI_NM_finished, dance_GUI_NM_reset),
146 [ALT_NM] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, dance_ALT_NM_finished, dance_ALT_NM_reset),
147 [SFT_NM] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, dance_SFT_NM_finished, dance_SFT_NM_reset)
148};
149
150// backup
151// old R3 capslock, LT(NM_MODE,KC_BSPC),
152const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
153 [CL] = LAYOUT(
154 KC_GESC, 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_DEL,
155 MT(MOD_LGUI,KC_TAB), LT(NM_MODE,KC_Q), KC_W, LT(ACCENT,KC_F), KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSPC,
156 MT(MOD_LCTL,KC_BSPC), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT,
157 TD(SFT_NM), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, MT(MOD_LCTL,KC_COMM), MT(MOD_LSFT,KC_DOT), MT(MOD_LALT,KC_SLSH), LM(CL,MOD_LGUI|MOD_LSFT), TT(NM_MODE),
158 _______, TD(CTL_NM), TD(ALT_NM), KC_SPC, LM(CL,MOD_LGUI|MOD_LALT), OSL(ACCENT) , _______
159 ),
160 [NM_MODE] = LAYOUT(
161 KC_GRV, KC_MPRV, KC_MNXT, KC_MPLY, KC_END, _______, _______, _______, _______, _______, KC_HOME, _______, _______, RESET, KC_INS,
162 LGUI(KC_TAB), _______, LCTL(KC_RGHT), _______, _______, _______, _______, KC_UP, KC_PGUP, _______, _______, _______, TG(CL), KC_DEL,
163 _______, KC_LEFT, _______, KC_RGHT, _______, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, _______, KC_ENT, KC_QUOT, KC_LGUI,
164 KC_LSFT, _______, _______, _______, _______, LCTL(KC_LEFT), _______, _______, _______, _______, _______, TG(VI_MODE), TO(CL),
165 _______, TD(CTL_NM), TD(ALT_NM), KC_SPC, LM(CL,MOD_LGUI|MOD_LALT), OSL(ACCENT), _______
166 ),
167
168 [VI_MODE] = LAYOUT(
169 KC_GRV, KC_MPRV, KC_MNXT, KC_MPLY, LSFT(KC_END), KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, LSFT(KC_HOME), KC_F11, KC_F12, RESET, KC_INS,
170 LGUI(KC_TAB), _______, LSFT(LCTL(KC_RGHT)), _______, _______, _______, _______, LSFT(KC_UP), _______, _______, _______, _______, TG(CL), KC_BSPC,
171 _______, _______, _______, _______, _______, _______, LSFT(LCTL(KC_LEFT)), LSFT(KC_DOWN), LSFT(KC_RGHT), _______, KC_SCLN, KC_QUOT, KC_LGUI,
172 KC_LSFT, _______, _______, _______, _______, LSFT(LCTL(KC_LEFT)), _______, _______, _______, _______, KC_SLSH, OSM(MOD_LSFT), TO(CL),
173 _______, TD(CTL_NM), TD(ALT_NM), KC_SPC, LM(CL,MOD_LGUI|MOD_LALT), OSL(ACCENT), _______
174 ),
175 [ACCENT] = LAYOUT(
176 _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______,
177 _______, RGB_TOG, RGB_MODE_PLAIN, _______, _______, _______, _______, _______, DE_UE, _______, _______, _______, _______, _______,
178 _______, DE_AE, UC_Z, DE_SS, _______, _______, _______, _______, _______, _______, DE_OE, _______, _______,
179 OSL(ACCENT_CAP), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, TO(CL),
180 _______, _______, _______, _______, _______, _______, _______
181 ),
182 [ACCENT_CAP] = LAYOUT(
183 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
184 _______, _______, _______, _______, _______, _______, _______, _______, DE_UE_CAP, _______, _______, _______, _______, _______,
185 _______, DE_AE_CAP, _______, DE_SS, _______, _______, _______, _______, _______, _______, DE_OE_CAP, _______, TO(CL),
186 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
187 _______, _______, _______, _______, _______, _______, _______
188 ),
189};
190
diff --git a/keyboards/kbd6x/keymaps/othi/readme.md b/keyboards/kbd6x/keymaps/othi/readme.md
new file mode 100644
index 000000000..95be36d05
--- /dev/null
+++ b/keyboards/kbd6x/keymaps/othi/readme.md
@@ -0,0 +1,56 @@
1## Othi's Universal HHKB keymap
2
3### Goals
4- Colemak layout. If you don't use Colemak then you'll need to also change the arrow key bindigns in other layers
5
6- Vim-like navigation layer so you can use vim binding arrowkeys in non-vim environment
7
8- Good modifier support so you don't have to hold 14 modifier keys at the same time
9
10- RGB indicating layer change(only work with plain colors so far, don't put your rgb to pulsing or any non static animation)
11
12### Layers
13- **CL:**
14
15 The base layer, default is Colemak
16
17- **NM_MODE:**
18
19 Vim-like arrowkeys in the home row, it's `LHNE` for *JENK Colemak* and `HJKL` for *QWERTY*
20
21 Also `HOME`, `END` and next/prev word (`Ctrl + Left/Right`) in `0, 4, w, b` like in vim
22
23- **VI_MODE:**
24
25 The same as `NM_MODE` but with `KC_LSFT` held down for mostly highlighting
26
27- **ACCENT + ACCENT_CAP:**
28
29 Function row and Unicode characters
30
31### Modifiers and Tap Dance keys
32**LHS:**
33
34- Any Tap Dance key with the format of `TD(XXX_NM)` act as normal XXX modifier upon hold, but will hold **and** put you to `NM_MODE` when double click hold(a tap before the hold)(eg you can produce `Alt + PgUp` by pressing `Alt + Alt + U`)
35
36- `KC_TAB` acts as both `KC_TAB` on tap and `KC_LGUI` on hold
37
38- R3 CapsLock acts as both `KC_BSPC` on tap and `KC_LCTL` on hold
39
40- Holding `KC_Q` also puts you into `NM_MODE`
41
42- Holding `KC_F` puts you into `VI_MODE` for fast function keys
43
44**RHS:**
45
46- 3 keys `KC_SCLN`, `KC_DOT` and `KC_SLSH` in `CL` layer can also be held down for respectively `KC_LCTL`, `KC_LSFT`, `KC_LALT` for easier 2-hand modifier holding
47
48- Right modifiers hold the selected modifier with `KC_LGUI` at the same time, mainly for i3wm, you can change this to whatever combination you want
49
50### Misc. functionalities
51
52**Unicode:**
53
54- In case the keyboard output the 4-digit codepoint instead of the actual unicode, you need to change the rewrite input mode of the keyboard into the EEPROM(you only have to do this if the EEPROM was cleared or your current machine use another unicode compose method other than IBus/Linux's `Ctrl + Shift + U`). Change the corresponding Input `void eeconfig_init_user(void)`. See [this](https://docs.qmk.fm/#/feature_unicode) for availble input modes.
55
56- **NOTE:** make sure to keep your qmk env up to date with upstream
diff --git a/keyboards/kbd6x/keymaps/othi/rules.mk b/keyboards/kbd6x/keymaps/othi/rules.mk
new file mode 100644
index 000000000..9cda4109d
--- /dev/null
+++ b/keyboards/kbd6x/keymaps/othi/rules.mk
@@ -0,0 +1,19 @@
1BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
2MOUSEKEY_ENABLE = no # Mouse keys(+4700)
3EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
4CONSOLE_ENABLE = no # Console for debug(+400)
5COMMAND_ENABLE = no # Commands for debug and configuration
6# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
7SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
8# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
9NKRO_ENABLE = yes # USB Nkey Rollover
10BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default
11MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
12UNICODE_ENABLE = yes # Unicode
13BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
14RGBLIGHT_ENABLE = yes
15AUDIO_ENABLE = no # Audio output on port C6
16FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
17HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400)
18TAP_DANCE_ENABLE=yes
19