diff options
-rw-r--r-- | docs/feature_audio.md | 2 | ||||
-rw-r--r-- | docs/feature_bootmagic.md | 11 | ||||
-rw-r--r-- | docs/keycodes.md | 11 | ||||
-rw-r--r-- | quantum/keycode_config.c | 38 | ||||
-rw-r--r-- | quantum/keycode_config.h | 2 | ||||
-rw-r--r-- | quantum/quantum.c | 48 | ||||
-rw-r--r-- | quantum/quantum_keycodes.h | 13 | ||||
-rw-r--r-- | tmk_core/common/command.c | 2 | ||||
-rw-r--r-- | tmk_core/common/eeconfig.c | 12 | ||||
-rw-r--r-- | tmk_core/common/eeconfig.h | 8 |
10 files changed, 136 insertions, 11 deletions
diff --git a/docs/feature_audio.md b/docs/feature_audio.md index 7511598bc..5132dfe97 100644 --- a/docs/feature_audio.md +++ b/docs/feature_audio.md | |||
@@ -21,6 +21,8 @@ STARTUP_SONG // plays when the keyboard starts up (audio.c) | |||
21 | GOODBYE_SONG // plays when you press the RESET key (quantum.c) | 21 | GOODBYE_SONG // plays when you press the RESET key (quantum.c) |
22 | AG_NORM_SONG // plays when you press AG_NORM (quantum.c) | 22 | AG_NORM_SONG // plays when you press AG_NORM (quantum.c) |
23 | AG_SWAP_SONG // plays when you press AG_SWAP (quantum.c) | 23 | AG_SWAP_SONG // plays when you press AG_SWAP (quantum.c) |
24 | CG_NORM_SONG // plays when you press CG_NORM (quantum.c) | ||
25 | CG_SWAP_SONG // plays when you press CG_SWAP (quantum.c) | ||
24 | MUSIC_ON_SONG // plays when music mode is activated (process_music.c) | 26 | MUSIC_ON_SONG // plays when music mode is activated (process_music.c) |
25 | MUSIC_OFF_SONG // plays when music mode is deactivated (process_music.c) | 27 | MUSIC_OFF_SONG // plays when music mode is deactivated (process_music.c) |
26 | CHROMATIC_SONG // plays when the chromatic music mode is selected (process_music.c) | 28 | CHROMATIC_SONG // plays when the chromatic music mode is selected (process_music.c) |
diff --git a/docs/feature_bootmagic.md b/docs/feature_bootmagic.md index 225189ccb..fc37a3302 100644 --- a/docs/feature_bootmagic.md +++ b/docs/feature_bootmagic.md | |||
@@ -64,8 +64,11 @@ Hold down the Bootmagic key (Space by default) and the desired hotkey while plug | |||
64 | |`MAGIC_NO_GUI` | |Disable the GUI keys (useful when gaming) | | 64 | |`MAGIC_NO_GUI` | |Disable the GUI keys (useful when gaming) | |
65 | |`MAGIC_UNNO_GUI` | |Enable the GUI keys | | 65 | |`MAGIC_UNNO_GUI` | |Enable the GUI keys | |
66 | |`MAGIC_SWAP_ALT_GUI` |`AG_SWAP`|Swap Alt and GUI on both sides (for macOS)| | 66 | |`MAGIC_SWAP_ALT_GUI` |`AG_SWAP`|Swap Alt and GUI on both sides (for macOS)| |
67 | |`MAGIC_UNSWAP_ALT_GUI` |`AG_NORM`|Unswap Left Alt and Left GUI | | 67 | |`MAGIC_UNSWAP_ALT_GUI` |`AG_NORM`|Unswap Alt and GUI | |
68 | |`MAGIC_TOGGLE_ALT_GUI` |`AG_TOGG`|Toggle Left Alt and GUI swap | | 68 | |`MAGIC_TOGGLE_ALT_GUI` |`AG_TOGG`|Toggle Alt and GUI swap | |
69 | |`MAGIC_SWAP_CTL_GUI` |`CG_SWAP`|Swap Ctrl and GUI on both sides (for macOS)| | ||
70 | |`MAGIC_UNSWAP_CTL_GUI` |`CG_NORM`|Unswap Ctrl and GUI | | ||
71 | |`MAGIC_TOGGLE_CTL_GUI` |`CG_TOGG`|Toggle Ctrl and GUI swap | | ||
69 | |`MAGIC_SWAP_BACKSLASH_BACKSPACE` | |Swap `\` and Backspace | | 72 | |`MAGIC_SWAP_BACKSLASH_BACKSPACE` | |Swap `\` and Backspace | |
70 | |`MAGIC_UNSWAP_BACKSLASH_BACKSPACE`| |Unswap `\` and Backspace | | 73 | |`MAGIC_UNSWAP_BACKSLASH_BACKSPACE`| |Unswap `\` and Backspace | |
71 | |`MAGIC_SWAP_CONTROL_CAPSLOCK` | |Swap Left Control and Caps Lock | | 74 | |`MAGIC_SWAP_CONTROL_CAPSLOCK` | |Swap Left Control and Caps Lock | |
@@ -76,6 +79,10 @@ Hold down the Bootmagic key (Space by default) and the desired hotkey while plug | |||
76 | |`MAGIC_UNSWAP_LALT_LGUI` | |Unswap Left Alt and Left GUI | | 79 | |`MAGIC_UNSWAP_LALT_LGUI` | |Unswap Left Alt and Left GUI | |
77 | |`MAGIC_SWAP_RALT_RGUI` | |Swap Right Alt and Right GUI | | 80 | |`MAGIC_SWAP_RALT_RGUI` | |Swap Right Alt and Right GUI | |
78 | |`MAGIC_UNSWAP_RALT_RGUI` | |Unswap Right Alt and Right GUI | | 81 | |`MAGIC_UNSWAP_RALT_RGUI` | |Unswap Right Alt and Right GUI | |
82 | |`MAGIC_SWAP_LCTL_LGUI` | |Swap Left Control and Left GUI | | ||
83 | |`MAGIC_UNSWAP_LCTL_LGUI` | |Unswap Left Control and Left GUI | | ||
84 | |`MAGIC_SWAP_RCTL_RGUI` | |Swap Right Control and Right GUI | | ||
85 | |`MAGIC_UNSWAP_RCTL_RGUI` | |Unswap Right Control and Right GUI | | ||
79 | 86 | ||
80 | ## Configuration | 87 | ## Configuration |
81 | 88 | ||
diff --git a/docs/keycodes.md b/docs/keycodes.md index bd4dd61a5..e17fef6fd 100644 --- a/docs/keycodes.md +++ b/docs/keycodes.md | |||
@@ -261,6 +261,8 @@ This is a reference only. Each group of keys links to the page documenting their | |||
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 | | ||
265 | |`MAGIC_SWAP_RCTL_RGUI` | |Swap Right Control and GUI | | ||
264 | |`MAGIC_SWAP_LALT_LGUI` | |Swap Left Alt and GUI | | 266 | |`MAGIC_SWAP_LALT_LGUI` | |Swap Left Alt and GUI | |
265 | |`MAGIC_SWAP_RALT_RGUI` | |Swap Right Alt and GUI | | 267 | |`MAGIC_SWAP_RALT_RGUI` | |Swap Right Alt and GUI | |
266 | |`MAGIC_NO_GUI` | |Disable the GUI key | | 268 | |`MAGIC_NO_GUI` | |Disable the GUI key | |
@@ -268,8 +270,11 @@ This is a reference only. Each group of keys links to the page documenting their | |||
268 | |`MAGIC_SWAP_BACKSLASH_BACKSPACE` | |Swap `\` and Backspace | | 270 | |`MAGIC_SWAP_BACKSLASH_BACKSPACE` | |Swap `\` and Backspace | |
269 | |`MAGIC_HOST_NKRO` | |Force NKRO on | | 271 | |`MAGIC_HOST_NKRO` | |Force NKRO on | |
270 | |`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)| | ||
271 | |`MAGIC_UNSWAP_CONTROL_CAPSLOCK` | |Unswap Caps Lock and Left Control | | 274 | |`MAGIC_UNSWAP_CONTROL_CAPSLOCK` | |Unswap Caps Lock and Left Control | |
272 | |`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 | | ||
277 | |`MAGIC_UNSWAP_RCTL_RGUI` | |Unswap Right Control and GUI | | ||
273 | |`MAGIC_UNSWAP_LALT_LGUI` | |Unswap Left Alt and GUI | | 278 | |`MAGIC_UNSWAP_LALT_LGUI` | |Unswap Left Alt and GUI | |
274 | |`MAGIC_UNSWAP_RALT_RGUI` | |Unswap Right Alt and GUI | | 279 | |`MAGIC_UNSWAP_RALT_RGUI` | |Unswap Right Alt and GUI | |
275 | |`MAGIC_UNNO_GUI` | |Enable the GUI key | | 280 | |`MAGIC_UNNO_GUI` | |Enable the GUI key | |
@@ -277,8 +282,10 @@ This is a reference only. Each group of keys links to the page documenting their | |||
277 | |`MAGIC_UNSWAP_BACKSLASH_BACKSPACE`| |Unswap `\` and Backspace | | 282 | |`MAGIC_UNSWAP_BACKSLASH_BACKSPACE`| |Unswap `\` and Backspace | |
278 | |`MAGIC_UNHOST_NKRO` | |Force NKRO off | | 283 | |`MAGIC_UNHOST_NKRO` | |Force NKRO off | |
279 | |`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 | |
280 | |`MAGIC_TOGGLE_ALT_GUI` |`AG_TOGG`|Toggle Alt and GUI swap on both sides| | 285 | |`MAGIC_UNSWAP_CTL_GUI` |`CG_NORM`|Unswap Ctrl and GUI on both sides | |
281 | |`MAGIC_TOGGLE_NKRO` | |Turn NKRO on or off | | 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 | | ||
288 | |`MAGIC_TOGGLE_NKRO` | |Turn NKRO on or off | | ||
282 | 289 | ||
283 | ## [Bluetooth](feature_bluetooth.md) | 290 | ## [Bluetooth](feature_bluetooth.md) |
284 | 291 | ||
diff --git a/quantum/keycode_config.c b/quantum/keycode_config.c index 0dc5105d2..73fe15861 100644 --- a/quantum/keycode_config.c +++ b/quantum/keycode_config.c | |||
@@ -31,6 +31,12 @@ uint16_t keycode_config(uint16_t keycode) { | |||
31 | if (keymap_config.swap_control_capslock) { | 31 | if (keymap_config.swap_control_capslock) { |
32 | return KC_CAPSLOCK; | 32 | return KC_CAPSLOCK; |
33 | } | 33 | } |
34 | if (keymap_config.swap_lctl_lgui) { | ||
35 | if (keymap_config.no_gui) { | ||
36 | return KC_NO; | ||
37 | } | ||
38 | return KC_LGUI; | ||
39 | } | ||
34 | return KC_LCTL; | 40 | return KC_LCTL; |
35 | case KC_LALT: | 41 | case KC_LALT: |
36 | if (keymap_config.swap_lalt_lgui) { | 42 | if (keymap_config.swap_lalt_lgui) { |
@@ -44,10 +50,21 @@ uint16_t keycode_config(uint16_t keycode) { | |||
44 | if (keymap_config.swap_lalt_lgui) { | 50 | if (keymap_config.swap_lalt_lgui) { |
45 | return KC_LALT; | 51 | return KC_LALT; |
46 | } | 52 | } |
53 | if (keymap_config.swap_lctl_lgui) { | ||
54 | return KC_LCTRL; | ||
55 | } | ||
47 | if (keymap_config.no_gui) { | 56 | if (keymap_config.no_gui) { |
48 | return KC_NO; | 57 | return KC_NO; |
49 | } | 58 | } |
50 | return KC_LGUI; | 59 | return KC_LGUI; |
60 | case KC_RCTL: | ||
61 | if (keymap_config.swap_rctl_rgui) { | ||
62 | if (keymap_config.no_gui) { | ||
63 | return KC_NO; | ||
64 | } | ||
65 | return KC_RGUI; | ||
66 | } | ||
67 | return KC_RCTL; | ||
51 | case KC_RALT: | 68 | case KC_RALT: |
52 | if (keymap_config.swap_ralt_rgui) { | 69 | if (keymap_config.swap_ralt_rgui) { |
53 | if (keymap_config.no_gui) { | 70 | if (keymap_config.no_gui) { |
@@ -60,6 +77,9 @@ uint16_t keycode_config(uint16_t keycode) { | |||
60 | if (keymap_config.swap_ralt_rgui) { | 77 | if (keymap_config.swap_ralt_rgui) { |
61 | return KC_RALT; | 78 | return KC_RALT; |
62 | } | 79 | } |
80 | if (keymap_config.swap_rctl_rgui) { | ||
81 | return KC_RCTL; | ||
82 | } | ||
63 | if (keymap_config.no_gui) { | 83 | if (keymap_config.no_gui) { |
64 | return KC_NO; | 84 | return KC_NO; |
65 | } | 85 | } |
@@ -108,6 +128,24 @@ uint8_t mod_config(uint8_t mod) { | |||
108 | mod |= MOD_RGUI; | 128 | mod |= MOD_RGUI; |
109 | } | 129 | } |
110 | } | 130 | } |
131 | if (keymap_config.swap_lctl_lgui) { | ||
132 | if ((mod & MOD_RGUI) == MOD_LGUI) { | ||
133 | mod &= ~MOD_LGUI; | ||
134 | mod |= MOD_LCTL; | ||
135 | } else if ((mod & MOD_RCTL) == MOD_LCTL) { | ||
136 | mod &= ~MOD_LCTL; | ||
137 | mod |= MOD_LGUI; | ||
138 | } | ||
139 | } | ||
140 | if (keymap_config.swap_rctl_rgui) { | ||
141 | if ((mod & MOD_RGUI) == MOD_RGUI) { | ||
142 | mod &= ~MOD_RGUI; | ||
143 | mod |= MOD_RCTL; | ||
144 | } else if ((mod & MOD_RCTL) == MOD_RCTL) { | ||
145 | mod &= ~MOD_RCTL; | ||
146 | mod |= MOD_RGUI; | ||
147 | } | ||
148 | } | ||
111 | if (keymap_config.no_gui) { | 149 | if (keymap_config.no_gui) { |
112 | mod &= ~MOD_LGUI; | 150 | mod &= ~MOD_LGUI; |
113 | mod &= ~MOD_RGUI; | 151 | mod &= ~MOD_RGUI; |
diff --git a/quantum/keycode_config.h b/quantum/keycode_config.h index 022f4bd19..7b01fcea4 100644 --- a/quantum/keycode_config.h +++ b/quantum/keycode_config.h | |||
@@ -36,6 +36,8 @@ typedef union { | |||
36 | bool swap_grave_esc:1; | 36 | bool swap_grave_esc:1; |
37 | bool swap_backslash_backspace:1; | 37 | bool swap_backslash_backspace:1; |
38 | bool nkro:1; | 38 | bool nkro:1; |
39 | bool swap_lctl_lgui:1; | ||
40 | bool swap_rctl_rgui:1; | ||
39 | }; | 41 | }; |
40 | } keymap_config_t; | 42 | } keymap_config_t; |
41 | 43 | ||
diff --git a/quantum/quantum.c b/quantum/quantum.c index 77cbbb2e7..f489c9031 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c | |||
@@ -65,9 +65,17 @@ extern backlight_config_t backlight_config; | |||
65 | #ifndef AG_SWAP_SONG | 65 | #ifndef AG_SWAP_SONG |
66 | #define AG_SWAP_SONG SONG(AG_SWAP_SOUND) | 66 | #define AG_SWAP_SONG SONG(AG_SWAP_SOUND) |
67 | #endif | 67 | #endif |
68 | #ifndef CG_NORM_SONG | ||
69 | #define CG_NORM_SONG SONG(AG_NORM_SOUND) | ||
70 | #endif | ||
71 | #ifndef CG_SWAP_SONG | ||
72 | #define CG_SWAP_SONG SONG(AG_SWAP_SOUND) | ||
73 | #endif | ||
68 | float goodbye_song[][2] = GOODBYE_SONG; | 74 | float goodbye_song[][2] = GOODBYE_SONG; |
69 | float ag_norm_song[][2] = AG_NORM_SONG; | 75 | float ag_norm_song[][2] = AG_NORM_SONG; |
70 | float ag_swap_song[][2] = AG_SWAP_SONG; | 76 | float ag_swap_song[][2] = AG_SWAP_SONG; |
77 | float cg_norm_song[][2] = CG_NORM_SONG; | ||
78 | float cg_swap_song[][2] = CG_SWAP_SONG; | ||
71 | #ifdef DEFAULT_LAYER_SONGS | 79 | #ifdef DEFAULT_LAYER_SONGS |
72 | float default_layer_songs[][16][2] = DEFAULT_LAYER_SONGS; | 80 | float default_layer_songs[][16][2] = DEFAULT_LAYER_SONGS; |
73 | #endif | 81 | #endif |
@@ -563,7 +571,8 @@ bool process_record_quantum(keyrecord_t *record) { | |||
563 | return false; | 571 | return false; |
564 | #endif | 572 | #endif |
565 | #endif | 573 | #endif |
566 | case MAGIC_SWAP_CONTROL_CAPSLOCK ... MAGIC_TOGGLE_NKRO: | 574 | case MAGIC_SWAP_CONTROL_CAPSLOCK ... MAGIC_TOGGLE_ALT_GUI: |
575 | case MAGIC_SWAP_LCTL_LGUI ... MAGIC_TOGGLE_CTL_GUI: | ||
567 | if (record->event.pressed) { | 576 | if (record->event.pressed) { |
568 | // MAGIC actions (BOOTMAGIC without the boot) | 577 | // MAGIC actions (BOOTMAGIC without the boot) |
569 | if (!eeconfig_is_enabled()) { | 578 | if (!eeconfig_is_enabled()) { |
@@ -585,6 +594,12 @@ bool process_record_quantum(keyrecord_t *record) { | |||
585 | case MAGIC_SWAP_RALT_RGUI: | 594 | case MAGIC_SWAP_RALT_RGUI: |
586 | keymap_config.swap_ralt_rgui = true; | 595 | keymap_config.swap_ralt_rgui = true; |
587 | break; | 596 | break; |
597 | case MAGIC_SWAP_LCTL_LGUI: | ||
598 | keymap_config.swap_lctl_lgui = true; | ||
599 | break; | ||
600 | case MAGIC_SWAP_RCTL_RGUI: | ||
601 | keymap_config.swap_rctl_rgui = true; | ||
602 | break; | ||
588 | case MAGIC_NO_GUI: | 603 | case MAGIC_NO_GUI: |
589 | keymap_config.no_gui = true; | 604 | keymap_config.no_gui = true; |
590 | break; | 605 | break; |
@@ -604,6 +619,13 @@ bool process_record_quantum(keyrecord_t *record) { | |||
604 | PLAY_SONG(ag_swap_song); | 619 | PLAY_SONG(ag_swap_song); |
605 | #endif | 620 | #endif |
606 | break; | 621 | break; |
622 | case MAGIC_SWAP_CTL_GUI: | ||
623 | keymap_config.swap_lctl_lgui = true; | ||
624 | keymap_config.swap_rctl_rgui = true; | ||
625 | #ifdef AUDIO_ENABLE | ||
626 | PLAY_SONG(cg_swap_song); | ||
627 | #endif | ||
628 | break; | ||
607 | case MAGIC_UNSWAP_CONTROL_CAPSLOCK: | 629 | case MAGIC_UNSWAP_CONTROL_CAPSLOCK: |
608 | keymap_config.swap_control_capslock = false; | 630 | keymap_config.swap_control_capslock = false; |
609 | break; | 631 | break; |
@@ -616,6 +638,12 @@ bool process_record_quantum(keyrecord_t *record) { | |||
616 | case MAGIC_UNSWAP_RALT_RGUI: | 638 | case MAGIC_UNSWAP_RALT_RGUI: |
617 | keymap_config.swap_ralt_rgui = false; | 639 | keymap_config.swap_ralt_rgui = false; |
618 | break; | 640 | break; |
641 | case MAGIC_UNSWAP_LCTL_LGUI: | ||
642 | keymap_config.swap_lctl_lgui = false; | ||
643 | break; | ||
644 | case MAGIC_UNSWAP_RCTL_RGUI: | ||
645 | keymap_config.swap_rctl_rgui = false; | ||
646 | break; | ||
619 | case MAGIC_UNNO_GUI: | 647 | case MAGIC_UNNO_GUI: |
620 | keymap_config.no_gui = false; | 648 | keymap_config.no_gui = false; |
621 | break; | 649 | break; |
@@ -635,6 +663,13 @@ bool process_record_quantum(keyrecord_t *record) { | |||
635 | PLAY_SONG(ag_norm_song); | 663 | PLAY_SONG(ag_norm_song); |
636 | #endif | 664 | #endif |
637 | break; | 665 | break; |
666 | case MAGIC_UNSWAP_CTL_GUI: | ||
667 | keymap_config.swap_lctl_lgui = false; | ||
668 | keymap_config.swap_rctl_rgui = false; | ||
669 | #ifdef AUDIO_ENABLE | ||
670 | PLAY_SONG(cg_norm_song); | ||
671 | #endif | ||
672 | break; | ||
638 | case MAGIC_TOGGLE_ALT_GUI: | 673 | case MAGIC_TOGGLE_ALT_GUI: |
639 | keymap_config.swap_lalt_lgui = !keymap_config.swap_lalt_lgui; | 674 | keymap_config.swap_lalt_lgui = !keymap_config.swap_lalt_lgui; |
640 | keymap_config.swap_ralt_rgui = !keymap_config.swap_ralt_rgui; | 675 | keymap_config.swap_ralt_rgui = !keymap_config.swap_ralt_rgui; |
@@ -646,6 +681,17 @@ bool process_record_quantum(keyrecord_t *record) { | |||
646 | } | 681 | } |
647 | #endif | 682 | #endif |
648 | break; | 683 | break; |
684 | case MAGIC_TOGGLE_CTL_GUI: | ||
685 | keymap_config.swap_lctl_lgui = !keymap_config.swap_lctl_lgui; | ||
686 | keymap_config.swap_rctl_rgui = !keymap_config.swap_rctl_rgui; | ||
687 | #ifdef AUDIO_ENABLE | ||
688 | if (keymap_config.swap_rctl_rgui) { | ||
689 | PLAY_SONG(cg_swap_song); | ||
690 | } else { | ||
691 | PLAY_SONG(cg_norm_song); | ||
692 | } | ||
693 | #endif | ||
694 | break; | ||
649 | case MAGIC_TOGGLE_NKRO: | 695 | case MAGIC_TOGGLE_NKRO: |
650 | keymap_config.nkro = !keymap_config.nkro; | 696 | keymap_config.nkro = !keymap_config.nkro; |
651 | break; | 697 | break; |
diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index b5c6783e5..bb16da4d5 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h | |||
@@ -492,6 +492,15 @@ enum quantum_keycodes { | |||
492 | CMB_ON, | 492 | CMB_ON, |
493 | CMB_OFF, | 493 | CMB_OFF, |
494 | CMB_TOG, | 494 | CMB_TOG, |
495 | |||
496 | MAGIC_SWAP_LCTL_LGUI, | ||
497 | MAGIC_SWAP_RCTL_RGUI, | ||
498 | MAGIC_UNSWAP_LCTL_LGUI, | ||
499 | MAGIC_UNSWAP_RCTL_RGUI, | ||
500 | MAGIC_SWAP_CTL_GUI, | ||
501 | MAGIC_UNSWAP_CTL_GUI, | ||
502 | MAGIC_TOGGLE_CTL_GUI, | ||
503 | |||
495 | // always leave at the end | 504 | // always leave at the end |
496 | SAFE_RANGE | 505 | SAFE_RANGE |
497 | }; | 506 | }; |
@@ -639,6 +648,10 @@ enum quantum_keycodes { | |||
639 | #define AG_NORM MAGIC_UNSWAP_ALT_GUI | 648 | #define AG_NORM MAGIC_UNSWAP_ALT_GUI |
640 | #define AG_TOGG MAGIC_TOGGLE_ALT_GUI | 649 | #define AG_TOGG MAGIC_TOGGLE_ALT_GUI |
641 | 650 | ||
651 | #define CG_SWAP MAGIC_SWAP_CTL_GUI | ||
652 | #define CG_NORM MAGIC_UNSWAP_CTL_GUI | ||
653 | #define CG_TOGG MAGIC_TOGGLE_CTL_GUI | ||
654 | |||
642 | // GOTO layer - 16 layers max | 655 | // GOTO layer - 16 layers max |
643 | // when: | 656 | // when: |
644 | // ON_PRESS = 1 | 657 | // ON_PRESS = 1 |
diff --git a/tmk_core/common/command.c b/tmk_core/common/command.c index d3884d9fa..949615ecf 100644 --- a/tmk_core/common/command.c +++ b/tmk_core/common/command.c | |||
@@ -286,6 +286,8 @@ static void print_eeconfig(void) | |||
286 | print("keymap_config.raw: "); print_hex8(kc.raw); print("\n"); | 286 | print("keymap_config.raw: "); print_hex8(kc.raw); print("\n"); |
287 | print(".swap_control_capslock: "); print_dec(kc.swap_control_capslock); print("\n"); | 287 | print(".swap_control_capslock: "); print_dec(kc.swap_control_capslock); print("\n"); |
288 | print(".capslock_to_control: "); print_dec(kc.capslock_to_control); print("\n"); | 288 | print(".capslock_to_control: "); print_dec(kc.capslock_to_control); print("\n"); |
289 | print(".swap_lctl_lgui: "); print_dec(kc.swap_lctl_lgui); print("\n"); | ||
290 | print(".swap_rctl_rgui: "); print_dec(kc.swap_rctl_rgui); print("\n"); | ||
289 | print(".swap_lalt_lgui: "); print_dec(kc.swap_lalt_lgui); print("\n"); | 291 | print(".swap_lalt_lgui: "); print_dec(kc.swap_lalt_lgui); print("\n"); |
290 | print(".swap_ralt_rgui: "); print_dec(kc.swap_ralt_rgui); print("\n"); | 292 | print(".swap_ralt_rgui: "); print_dec(kc.swap_ralt_rgui); print("\n"); |
291 | print(".no_gui: "); print_dec(kc.no_gui); print("\n"); | 293 | print(".no_gui: "); print_dec(kc.no_gui); print("\n"); |
diff --git a/tmk_core/common/eeconfig.c b/tmk_core/common/eeconfig.c index 4f440abc9..28f5d3ad5 100644 --- a/tmk_core/common/eeconfig.c +++ b/tmk_core/common/eeconfig.c | |||
@@ -39,7 +39,8 @@ void eeconfig_init_quantum(void) { | |||
39 | eeprom_update_byte(EECONFIG_DEBUG, 0); | 39 | eeprom_update_byte(EECONFIG_DEBUG, 0); |
40 | eeprom_update_byte(EECONFIG_DEFAULT_LAYER, 0); | 40 | eeprom_update_byte(EECONFIG_DEFAULT_LAYER, 0); |
41 | default_layer_state = 0; | 41 | default_layer_state = 0; |
42 | eeprom_update_byte(EECONFIG_KEYMAP, 0); | 42 | eeprom_update_byte(EECONFIG_KEYMAP_LOWER_BYTE, 0); |
43 | eeprom_update_byte(EECONFIG_KEYMAP_UPPER_BYTE, 0); | ||
43 | eeprom_update_byte(EECONFIG_MOUSEKEY_ACCEL, 0); | 44 | eeprom_update_byte(EECONFIG_MOUSEKEY_ACCEL, 0); |
44 | eeprom_update_byte(EECONFIG_BACKLIGHT, 0); | 45 | eeprom_update_byte(EECONFIG_BACKLIGHT, 0); |
45 | eeprom_update_byte(EECONFIG_AUDIO, 0xFF); // On by default | 46 | eeprom_update_byte(EECONFIG_AUDIO, 0xFF); // On by default |
@@ -127,12 +128,17 @@ void eeconfig_update_default_layer(uint8_t val) { eeprom_update_byte(EECONFIG_DE | |||
127 | * | 128 | * |
128 | * FIXME: needs doc | 129 | * FIXME: needs doc |
129 | */ | 130 | */ |
130 | uint8_t eeconfig_read_keymap(void) { return eeprom_read_byte(EECONFIG_KEYMAP); } | 131 | uint16_t eeconfig_read_keymap(void) { |
132 | return ( eeprom_read_byte(EECONFIG_KEYMAP_LOWER_BYTE) | (eeprom_read_byte(EECONFIG_KEYMAP_UPPER_BYTE) << 8) ); | ||
133 | } | ||
131 | /** \brief eeconfig update keymap | 134 | /** \brief eeconfig update keymap |
132 | * | 135 | * |
133 | * FIXME: needs doc | 136 | * FIXME: needs doc |
134 | */ | 137 | */ |
135 | void eeconfig_update_keymap(uint8_t val) { eeprom_update_byte(EECONFIG_KEYMAP, val); } | 138 | void eeconfig_update_keymap(uint16_t val) { |
139 | eeprom_update_byte(EECONFIG_KEYMAP_LOWER_BYTE, val & 0xFF); | ||
140 | eeprom_update_byte(EECONFIG_KEYMAP_UPPER_BYTE, ( val >> 8 ) & 0xFF ); | ||
141 | } | ||
136 | 142 | ||
137 | /** \brief eeconfig read backlight | 143 | /** \brief eeconfig read backlight |
138 | * | 144 | * |
diff --git a/tmk_core/common/eeconfig.h b/tmk_core/common/eeconfig.h index 3100041b4..0d5c6a82f 100644 --- a/tmk_core/common/eeconfig.h +++ b/tmk_core/common/eeconfig.h | |||
@@ -45,7 +45,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
45 | #define EECONFIG_HAPTIC (uint32_t *)24 | 45 | #define EECONFIG_HAPTIC (uint32_t *)24 |
46 | #define EECONFIG_RGB_MATRIX (uint32_t *)28 | 46 | #define EECONFIG_RGB_MATRIX (uint32_t *)28 |
47 | #define EECONFIG_RGB_MATRIX_SPEED (uint8_t *)32 | 47 | #define EECONFIG_RGB_MATRIX_SPEED (uint8_t *)32 |
48 | 48 | // TODO: Combine these into a single word and single block of EEPROM | |
49 | #define EECONFIG_KEYMAP_UPPER_BYTE (uint8_t *)33 | ||
49 | /* debug bit */ | 50 | /* debug bit */ |
50 | #define EECONFIG_DEBUG_ENABLE (1<<0) | 51 | #define EECONFIG_DEBUG_ENABLE (1<<0) |
51 | #define EECONFIG_DEBUG_MATRIX (1<<1) | 52 | #define EECONFIG_DEBUG_MATRIX (1<<1) |
@@ -62,6 +63,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
62 | #define EECONFIG_KEYMAP_SWAP_BACKSLASH_BACKSPACE (1<<6) | 63 | #define EECONFIG_KEYMAP_SWAP_BACKSLASH_BACKSPACE (1<<6) |
63 | #define EECONFIG_KEYMAP_NKRO (1<<7) | 64 | #define EECONFIG_KEYMAP_NKRO (1<<7) |
64 | 65 | ||
66 | #define EECONFIG_KEYMAP_LOWER_BYTE EECONFIG_KEYMAP | ||
65 | 67 | ||
66 | bool eeconfig_is_enabled(void); | 68 | bool eeconfig_is_enabled(void); |
67 | bool eeconfig_is_disabled(void); | 69 | bool eeconfig_is_disabled(void); |
@@ -81,8 +83,8 @@ void eeconfig_update_debug(uint8_t val); | |||
81 | uint8_t eeconfig_read_default_layer(void); | 83 | uint8_t eeconfig_read_default_layer(void); |
82 | void eeconfig_update_default_layer(uint8_t val); | 84 | void eeconfig_update_default_layer(uint8_t val); |
83 | 85 | ||
84 | uint8_t eeconfig_read_keymap(void); | 86 | uint16_t eeconfig_read_keymap(void); |
85 | void eeconfig_update_keymap(uint8_t val); | 87 | void eeconfig_update_keymap(uint16_t val); |
86 | 88 | ||
87 | #ifdef BACKLIGHT_ENABLE | 89 | #ifdef BACKLIGHT_ENABLE |
88 | uint8_t eeconfig_read_backlight(void); | 90 | uint8_t eeconfig_read_backlight(void); |