diff options
-rw-r--r-- | docs/feature_bootmagic.md | 6 | ||||
-rw-r--r-- | docs/keycodes.md | 58 | ||||
-rw-r--r-- | quantum/quantum.c | 8 | ||||
-rw-r--r-- | quantum/quantum_keycodes.h | 2 | ||||
-rw-r--r-- | quantum/split_common/split_util.c | 3 | ||||
-rw-r--r-- | tmk_core/common/bootmagic.c | 8 | ||||
-rw-r--r-- | tmk_core/common/bootmagic.h | 6 | ||||
-rw-r--r-- | tmk_core/common/eeconfig.c | 19 | ||||
-rw-r--r-- | tmk_core/common/eeconfig.h | 3 |
9 files changed, 80 insertions, 33 deletions
diff --git a/docs/feature_bootmagic.md b/docs/feature_bootmagic.md index fc37a3302..ed00d5129 100644 --- a/docs/feature_bootmagic.md +++ b/docs/feature_bootmagic.md | |||
@@ -34,6 +34,8 @@ Hold down the Bootmagic key (Space by default) and the desired hotkey while plug | |||
34 | |`X` |Toggle key matrix debugging | | 34 | |`X` |Toggle key matrix debugging | |
35 | |`K` |Toggle keyboard debugging | | 35 | |`K` |Toggle keyboard debugging | |
36 | |`M` |Toggle mouse debugging | | 36 | |`M` |Toggle mouse debugging | |
37 | |`L` |Set "Left Hand" for EE_HANDS handedness | | ||
38 | |`R` |Set "Right Hand" for EE_HANDS handedness | | ||
37 | |Backspace |Clear the EEPROM | | 39 | |Backspace |Clear the EEPROM | |
38 | |Caps Lock |Toggle treating Caps Lock as Left Control | | 40 | |Caps Lock |Toggle treating Caps Lock as Left Control | |
39 | |Left Control |Toggle swapping Caps Lock and Left Control | | 41 | |Left Control |Toggle swapping Caps Lock and Left Control | |
@@ -83,6 +85,8 @@ Hold down the Bootmagic key (Space by default) and the desired hotkey while plug | |||
83 | |`MAGIC_UNSWAP_LCTL_LGUI` | |Unswap Left Control and Left GUI | | 85 | |`MAGIC_UNSWAP_LCTL_LGUI` | |Unswap Left Control and Left GUI | |
84 | |`MAGIC_SWAP_RCTL_RGUI` | |Swap Right Control and Right GUI | | 86 | |`MAGIC_SWAP_RCTL_RGUI` | |Swap Right Control and Right GUI | |
85 | |`MAGIC_UNSWAP_RCTL_RGUI` | |Unswap Right Control and Right GUI | | 87 | |`MAGIC_UNSWAP_RCTL_RGUI` | |Unswap Right Control and Right GUI | |
88 | |`MAGIC_EE_HANDS_LEFT` | |Set "Left Hand" for EE_HANDS handedness | | ||
89 | |`MAGIC_EE_HANDS_RIGHT` | |Set "Right Hand" for EE_HANDS handedness | | ||
86 | 90 | ||
87 | ## Configuration | 91 | ## Configuration |
88 | 92 | ||
@@ -98,6 +102,8 @@ If you would like to change the hotkey assignments for Bootmagic, `#define` thes | |||
98 | |`BOOTMAGIC_KEY_DEBUG_MATRIX` |`KC_X` |Toggle matrix debugging | | 102 | |`BOOTMAGIC_KEY_DEBUG_MATRIX` |`KC_X` |Toggle matrix debugging | |
99 | |`BOOTMAGIC_KEY_DEBUG_KEYBOARD` |`KC_K` |Toggle keyboard debugging | | 103 | |`BOOTMAGIC_KEY_DEBUG_KEYBOARD` |`KC_K` |Toggle keyboard debugging | |
100 | |`BOOTMAGIC_KEY_DEBUG_MOUSE` |`KC_M` |Toggle mouse debugging | | 104 | |`BOOTMAGIC_KEY_DEBUG_MOUSE` |`KC_M` |Toggle mouse debugging | |
105 | |`BOOTMAGIC_KEY_EE_HANDS_LEFT` |`KC_L` |Set "Left Hand" for EE_HANDS handedness | | ||
106 | |`BOOTMAGIC_KEY_EE_HANDS_RIGHT` |`KC_R` |Set "Right Hand" for EE_HANDS handedness | | ||
101 | |`BOOTMAGIC_KEY_SWAP_CONTROL_CAPSLOCK` |`KC_LCTRL` |Swap Left Control and Caps Lock | | 107 | |`BOOTMAGIC_KEY_SWAP_CONTROL_CAPSLOCK` |`KC_LCTRL` |Swap Left Control and Caps Lock | |
102 | |`BOOTMAGIC_KEY_CAPSLOCK_TO_CONTROL` |`KC_CAPSLOCK`|Toggle treating Caps Lock as Left Control | | 108 | |`BOOTMAGIC_KEY_CAPSLOCK_TO_CONTROL` |`KC_CAPSLOCK`|Toggle treating Caps Lock as Left Control | |
103 | |`BOOTMAGIC_KEY_SWAP_LALT_LGUI` |`KC_LALT` |Toggle swapping Left Alt and Left GUI (for macOS) | | 109 | |`BOOTMAGIC_KEY_SWAP_LALT_LGUI` |`KC_LALT` |Toggle swapping Left Alt and Left GUI (for macOS) | |
diff --git a/docs/keycodes.md b/docs/keycodes.md index e17fef6fd..dfbab148b 100644 --- a/docs/keycodes.md +++ b/docs/keycodes.md | |||
@@ -257,35 +257,37 @@ This is a reference only. Each group of keys links to the page documenting their | |||
257 | 257 | ||
258 | ## [Bootmagic](feature_bootmagic.md) | 258 | ## [Bootmagic](feature_bootmagic.md) |
259 | 259 | ||
260 | |Key |Aliases |Description | | 260 | |Key |Aliases |Description | |
261 | |----------------------------------|---------|------------------------------------| | 261 | |----------------------------------|---------|-------------------------------------------| |
262 | |`MAGIC_SWAP_CONTROL_CAPSLOCK` | |Swap Caps Lock and Left Control | | 262 | |`MAGIC_SWAP_CONTROL_CAPSLOCK` | |Swap Caps Lock and Left Control | |
263 | |`MAGIC_CAPSLOCK_TO_CONTROL` | |Treat Caps Lock as Control | | 263 | |`MAGIC_CAPSLOCK_TO_CONTROL` | |Treat Caps Lock as Control | |
264 | |`MAGIC_SWAP_LCTL_LGUI` | |Swap Left Control and GUI | | 264 | |`MAGIC_SWAP_LCTL_LGUI` | |Swap Left Control and GUI | |
265 | |`MAGIC_SWAP_RCTL_RGUI` | |Swap Right Control and GUI | | 265 | |`MAGIC_SWAP_RCTL_RGUI` | |Swap Right Control and GUI | |
266 | |`MAGIC_SWAP_LALT_LGUI` | |Swap Left Alt and GUI | | 266 | |`MAGIC_SWAP_LALT_LGUI` | |Swap Left Alt and GUI | |
267 | |`MAGIC_SWAP_RALT_RGUI` | |Swap Right Alt and GUI | | 267 | |`MAGIC_SWAP_RALT_RGUI` | |Swap Right Alt and GUI | |
268 | |`MAGIC_NO_GUI` | |Disable the GUI key | | 268 | |`MAGIC_NO_GUI` | |Disable the GUI key | |
269 | |`MAGIC_SWAP_GRAVE_ESC` | |Swap <code>`</code> and Escape | | 269 | |`MAGIC_SWAP_GRAVE_ESC` | |Swap <code>`</code> and Escape | |
270 | |`MAGIC_SWAP_BACKSLASH_BACKSPACE` | |Swap `\` and Backspace | | 270 | |`MAGIC_SWAP_BACKSLASH_BACKSPACE` | |Swap `\` and Backspace | |
271 | |`MAGIC_HOST_NKRO` | |Force NKRO on | | 271 | |`MAGIC_HOST_NKRO` | |Force NKRO on | |
272 | |`MAGIC_SWAP_ALT_GUI` |`AG_SWAP`|Swap Alt and GUI on both sides | | 272 | |`MAGIC_SWAP_ALT_GUI` |`AG_SWAP`|Swap Alt and GUI on both sides | |
273 | |`MAGIC_SWAP_CTL_GUI` |`CG_SWAP`|Swap Ctrl and GUI on both sides (for macOS)| | 273 | |`MAGIC_SWAP_CTL_GUI` |`CG_SWAP`|Swap Ctrl and GUI on both sides (for macOS)| |
274 | |`MAGIC_UNSWAP_CONTROL_CAPSLOCK` | |Unswap Caps Lock and Left Control | | 274 | |`MAGIC_UNSWAP_CONTROL_CAPSLOCK` | |Unswap Caps Lock and Left Control | |
275 | |`MAGIC_UNCAPSLOCK_TO_CONTROL` | |Stop treating Caps Lock as Control | | 275 | |`MAGIC_UNCAPSLOCK_TO_CONTROL` | |Stop treating Caps Lock as Control | |
276 | |`MAGIC_UNSWAP_LCTL_LGUI` | |Unswap Left Control and GUI | | 276 | |`MAGIC_UNSWAP_LCTL_LGUI` | |Unswap Left Control and GUI | |
277 | |`MAGIC_UNSWAP_RCTL_RGUI` | |Unswap Right Control and GUI | | 277 | |`MAGIC_UNSWAP_RCTL_RGUI` | |Unswap Right Control and GUI | |
278 | |`MAGIC_UNSWAP_LALT_LGUI` | |Unswap Left Alt and GUI | | 278 | |`MAGIC_UNSWAP_LALT_LGUI` | |Unswap Left Alt and GUI | |
279 | |`MAGIC_UNSWAP_RALT_RGUI` | |Unswap Right Alt and GUI | | 279 | |`MAGIC_UNSWAP_RALT_RGUI` | |Unswap Right Alt and GUI | |
280 | |`MAGIC_UNNO_GUI` | |Enable the GUI key | | 280 | |`MAGIC_UNNO_GUI` | |Enable the GUI key | |
281 | |`MAGIC_UNSWAP_GRAVE_ESC` | |Unswap <code>`</code> and Escape| | 281 | |`MAGIC_UNSWAP_GRAVE_ESC` | |Unswap <code>`</code> and Escape | |
282 | |`MAGIC_UNSWAP_BACKSLASH_BACKSPACE`| |Unswap `\` and Backspace | | 282 | |`MAGIC_UNSWAP_BACKSLASH_BACKSPACE`| |Unswap `\` and Backspace | |
283 | |`MAGIC_UNHOST_NKRO` | |Force NKRO off | | 283 | |`MAGIC_UNHOST_NKRO` | |Force NKRO off | |
284 | |`MAGIC_UNSWAP_ALT_GUI` |`AG_NORM`|Unswap Alt and GUI on both sides | | 284 | |`MAGIC_UNSWAP_ALT_GUI` |`AG_NORM`|Unswap Alt and GUI on both sides | |
285 | |`MAGIC_UNSWAP_CTL_GUI` |`CG_NORM`|Unswap Ctrl and GUI on both sides | | 285 | |`MAGIC_UNSWAP_CTL_GUI` |`CG_NORM`|Unswap Ctrl and GUI on both sides | |
286 | |`MAGIC_TOGGLE_ALT_GUI` |`AG_TOGG`|Toggle Alt and GUI swap on both sides | | 286 | |`MAGIC_TOGGLE_ALT_GUI` |`AG_TOGG`|Toggle Alt and GUI swap on both sides | |
287 | |`MAGIC_TOGGLE_CTL_GUI` |`CG_TOGG`|Toggle Ctrl and GUI swap on both sides | | 287 | |`MAGIC_TOGGLE_CTL_GUI` |`CG_TOGG`|Toggle Ctrl and GUI swap on both sides | |
288 | |`MAGIC_TOGGLE_NKRO` | |Turn NKRO on or off | | 288 | |`MAGIC_TOGGLE_NKRO` | |Turn NKRO on or off | |
289 | |`MAGIC_EE_HANDS_LEFT` | |Set "Left Hand" for EE_HANDS handedness | | ||
290 | |`MAGIC_EE_HANDS_RIGHT` | |Set "Right Hand" for EE_HANDS handedness | | ||
289 | 291 | ||
290 | ## [Bluetooth](feature_bluetooth.md) | 292 | ## [Bluetooth](feature_bluetooth.md) |
291 | 293 | ||
diff --git a/quantum/quantum.c b/quantum/quantum.c index ec80fa557..16922dd01 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c | |||
@@ -544,7 +544,7 @@ bool process_record_quantum(keyrecord_t *record) { | |||
544 | # endif | 544 | # endif |
545 | #endif | 545 | #endif |
546 | case MAGIC_SWAP_CONTROL_CAPSLOCK ... MAGIC_TOGGLE_ALT_GUI: | 546 | case MAGIC_SWAP_CONTROL_CAPSLOCK ... MAGIC_TOGGLE_ALT_GUI: |
547 | case MAGIC_SWAP_LCTL_LGUI ... MAGIC_TOGGLE_CTL_GUI: | 547 | case MAGIC_SWAP_LCTL_LGUI ... MAGIC_EE_HANDS_RIGHT: |
548 | if (record->event.pressed) { | 548 | if (record->event.pressed) { |
549 | // MAGIC actions (BOOTMAGIC without the boot) | 549 | // MAGIC actions (BOOTMAGIC without the boot) |
550 | if (!eeconfig_is_enabled()) { | 550 | if (!eeconfig_is_enabled()) { |
@@ -662,6 +662,12 @@ bool process_record_quantum(keyrecord_t *record) { | |||
662 | case MAGIC_TOGGLE_NKRO: | 662 | case MAGIC_TOGGLE_NKRO: |
663 | keymap_config.nkro = !keymap_config.nkro; | 663 | keymap_config.nkro = !keymap_config.nkro; |
664 | break; | 664 | break; |
665 | case MAGIC_EE_HANDS_LEFT: | ||
666 | eeconfig_update_handedness(true); | ||
667 | break; | ||
668 | case MAGIC_EE_HANDS_RIGHT: | ||
669 | eeconfig_update_handedness(false); | ||
670 | break; | ||
665 | default: | 671 | default: |
666 | break; | 672 | break; |
667 | } | 673 | } |
diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index af984a7cd..5fac6a5ca 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h | |||
@@ -502,6 +502,8 @@ enum quantum_keycodes { | |||
502 | MAGIC_SWAP_CTL_GUI, | 502 | MAGIC_SWAP_CTL_GUI, |
503 | MAGIC_UNSWAP_CTL_GUI, | 503 | MAGIC_UNSWAP_CTL_GUI, |
504 | MAGIC_TOGGLE_CTL_GUI, | 504 | MAGIC_TOGGLE_CTL_GUI, |
505 | MAGIC_EE_HANDS_LEFT, | ||
506 | MAGIC_EE_HANDS_RIGHT, | ||
505 | 507 | ||
506 | // always leave at the end | 508 | // always leave at the end |
507 | SAFE_RANGE | 509 | SAFE_RANGE |
diff --git a/quantum/split_common/split_util.c b/quantum/split_common/split_util.c index 5114b188e..d16a98977 100644 --- a/quantum/split_common/split_util.c +++ b/quantum/split_common/split_util.c | |||
@@ -7,7 +7,6 @@ | |||
7 | #include "quantum.h" | 7 | #include "quantum.h" |
8 | 8 | ||
9 | #ifdef EE_HANDS | 9 | #ifdef EE_HANDS |
10 | # include "tmk_core/common/eeprom.h" | ||
11 | # include "eeconfig.h" | 10 | # include "eeconfig.h" |
12 | #endif | 11 | #endif |
13 | 12 | ||
@@ -23,7 +22,7 @@ __attribute__((weak)) bool is_keyboard_left(void) { | |||
23 | setPinInput(SPLIT_HAND_PIN); | 22 | setPinInput(SPLIT_HAND_PIN); |
24 | return readPin(SPLIT_HAND_PIN); | 23 | return readPin(SPLIT_HAND_PIN); |
25 | #elif defined(EE_HANDS) | 24 | #elif defined(EE_HANDS) |
26 | return eeprom_read_byte(EECONFIG_HANDEDNESS); | 25 | return eeconfig_read_handedness(); |
27 | #elif defined(MASTER_RIGHT) | 26 | #elif defined(MASTER_RIGHT) |
28 | return !is_keyboard_master(); | 27 | return !is_keyboard_master(); |
29 | #endif | 28 | #endif |
diff --git a/tmk_core/common/bootmagic.c b/tmk_core/common/bootmagic.c index 09b1664c9..bb2aa0db8 100644 --- a/tmk_core/common/bootmagic.c +++ b/tmk_core/common/bootmagic.c | |||
@@ -122,6 +122,14 @@ void bootmagic(void) { | |||
122 | default_layer = eeconfig_read_default_layer(); | 122 | default_layer = eeconfig_read_default_layer(); |
123 | default_layer_set((layer_state_t)default_layer); | 123 | default_layer_set((layer_state_t)default_layer); |
124 | } | 124 | } |
125 | |||
126 | /* EE_HANDS handedness */ | ||
127 | if (bootmagic_scan_keycode(BOOTMAGIC_KEY_EE_HANDS_LEFT)) { | ||
128 | eeconfig_update_handedness(true); | ||
129 | } | ||
130 | if (bootmagic_scan_keycode(BOOTMAGIC_KEY_EE_HANDS_RIGHT)) { | ||
131 | eeconfig_update_handedness(false); | ||
132 | } | ||
125 | } | 133 | } |
126 | 134 | ||
127 | /** \brief Scan Keycode | 135 | /** \brief Scan Keycode |
diff --git a/tmk_core/common/bootmagic.h b/tmk_core/common/bootmagic.h index fb7647257..c64dc1785 100644 --- a/tmk_core/common/bootmagic.h +++ b/tmk_core/common/bootmagic.h | |||
@@ -36,6 +36,12 @@ | |||
36 | #ifndef BOOTMAGIC_KEY_DEBUG_MOUSE | 36 | #ifndef BOOTMAGIC_KEY_DEBUG_MOUSE |
37 | # define BOOTMAGIC_KEY_DEBUG_MOUSE KC_M | 37 | # define BOOTMAGIC_KEY_DEBUG_MOUSE KC_M |
38 | #endif | 38 | #endif |
39 | #ifndef BOOTMAGIC_KEY_EE_HANDS_LEFT | ||
40 | # define BOOTMAGIC_KEY_EE_HANDS_LEFT KC_L | ||
41 | #endif | ||
42 | #ifndef BOOTMAGIC_KEY_EE_HANDS_RIGHT | ||
43 | # define BOOTMAGIC_KEY_EE_HANDS_RIGHT KC_R | ||
44 | #endif | ||
39 | 45 | ||
40 | /* | 46 | /* |
41 | * keymap config | 47 | * keymap config |
diff --git a/tmk_core/common/eeconfig.c b/tmk_core/common/eeconfig.c index 61aaec205..933ac42bd 100644 --- a/tmk_core/common/eeconfig.c +++ b/tmk_core/common/eeconfig.c | |||
@@ -153,8 +153,8 @@ uint32_t eeconfig_read_kb(void) { return eeprom_read_dword(EECONFIG_KEYBOARD); } | |||
153 | * | 153 | * |
154 | * FIXME: needs doc | 154 | * FIXME: needs doc |
155 | */ | 155 | */ |
156 | |||
157 | void eeconfig_update_kb(uint32_t val) { eeprom_update_dword(EECONFIG_KEYBOARD, val); } | 156 | void eeconfig_update_kb(uint32_t val) { eeprom_update_dword(EECONFIG_KEYBOARD, val); } |
157 | |||
158 | /** \brief eeconfig read user | 158 | /** \brief eeconfig read user |
159 | * | 159 | * |
160 | * FIXME: needs doc | 160 | * FIXME: needs doc |
@@ -166,9 +166,24 @@ uint32_t eeconfig_read_user(void) { return eeprom_read_dword(EECONFIG_USER); } | |||
166 | */ | 166 | */ |
167 | void eeconfig_update_user(uint32_t val) { eeprom_update_dword(EECONFIG_USER, val); } | 167 | void eeconfig_update_user(uint32_t val) { eeprom_update_dword(EECONFIG_USER, val); } |
168 | 168 | ||
169 | /** \brief eeconfig read haptic | ||
170 | * | ||
171 | * FIXME: needs doc | ||
172 | */ | ||
169 | uint32_t eeconfig_read_haptic(void) { return eeprom_read_dword(EECONFIG_HAPTIC); } | 173 | uint32_t eeconfig_read_haptic(void) { return eeprom_read_dword(EECONFIG_HAPTIC); } |
170 | /** \brief eeconfig update user | 174 | /** \brief eeconfig update haptic |
171 | * | 175 | * |
172 | * FIXME: needs doc | 176 | * FIXME: needs doc |
173 | */ | 177 | */ |
174 | void eeconfig_update_haptic(uint32_t val) { eeprom_update_dword(EECONFIG_HAPTIC, val); } | 178 | void eeconfig_update_haptic(uint32_t val) { eeprom_update_dword(EECONFIG_HAPTIC, val); } |
179 | |||
180 | /** \brief eeconfig read split handedness | ||
181 | * | ||
182 | * FIXME: needs doc | ||
183 | */ | ||
184 | bool eeconfig_read_handedness(void) { return !!eeprom_read_byte(EECONFIG_HANDEDNESS); } | ||
185 | /** \brief eeconfig update split handedness | ||
186 | * | ||
187 | * FIXME: needs doc | ||
188 | */ | ||
189 | void eeconfig_update_handedness(bool val) { eeprom_update_byte(EECONFIG_HANDEDNESS, !!val); } | ||
diff --git a/tmk_core/common/eeconfig.h b/tmk_core/common/eeconfig.h index aea4eff9f..308f865e1 100644 --- a/tmk_core/common/eeconfig.h +++ b/tmk_core/common/eeconfig.h | |||
@@ -107,4 +107,7 @@ uint32_t eeconfig_read_haptic(void); | |||
107 | void eeconfig_update_haptic(uint32_t val); | 107 | void eeconfig_update_haptic(uint32_t val); |
108 | #endif | 108 | #endif |
109 | 109 | ||
110 | bool eeconfig_read_handedness(void); | ||
111 | void eeconfig_update_handedness(bool val); | ||
112 | |||
110 | #endif | 113 | #endif |