diff options
Diffstat (limited to 'users')
| -rw-r--r-- | users/narze/narze.c | 1 | ||||
| -rw-r--r-- | users/narze/narze.h | 9 | ||||
| -rw-r--r-- | users/narze/readme.md | 18 | ||||
| -rw-r--r-- | users/narze/rules.mk | 5 | ||||
| -rw-r--r-- | users/narze/superduper.c | 66 | ||||
| -rw-r--r-- | users/narze/superduper.h | 7 |
6 files changed, 106 insertions, 0 deletions
diff --git a/users/narze/narze.c b/users/narze/narze.c new file mode 100644 index 000000000..6ec303449 --- /dev/null +++ b/users/narze/narze.c | |||
| @@ -0,0 +1 @@ | |||
| #include "narze.h" | |||
diff --git a/users/narze/narze.h b/users/narze/narze.h new file mode 100644 index 000000000..036539a9c --- /dev/null +++ b/users/narze/narze.h | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 3 | #include "quantum.h" | ||
| 4 | #include "eeconfig.h" | ||
| 5 | #include "keymap_colemak.h" | ||
| 6 | |||
| 7 | #ifdef COMBO_ENABLE | ||
| 8 | # include "superduper.h" | ||
| 9 | #endif | ||
diff --git a/users/narze/readme.md b/users/narze/readme.md new file mode 100644 index 000000000..124b84e6b --- /dev/null +++ b/users/narze/readme.md | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | # TODO | ||
| 2 | - [ ] Make SuperDuper mode fully-compatible in Windows by swapping GUI with Ctrl | ||
| 3 | |||
| 4 | # LICENSE | ||
| 5 | Copyright 2019 Manassarn Manoonchai manassarn@gmail.com @narze | ||
| 6 | |||
| 7 | This program is free software: you can redistribute it and/or modify | ||
| 8 | it under the terms of the GNU General Public License as published by | ||
| 9 | the Free Software Foundation, either version 2 of the License, or | ||
| 10 | (at your option) any later version. | ||
| 11 | |||
| 12 | This program is distributed in the hope that it will be useful, | ||
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | GNU General Public License for more details. | ||
| 16 | |||
| 17 | You should have received a copy of the GNU General Public License | ||
| 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
diff --git a/users/narze/rules.mk b/users/narze/rules.mk new file mode 100644 index 000000000..565a4a7a6 --- /dev/null +++ b/users/narze/rules.mk | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | SRC += narze.c | ||
| 2 | |||
| 3 | ifeq ($(strip $(COMBO_ENABLE)), yes) | ||
| 4 | SRC += superduper.c | ||
| 5 | endif | ||
diff --git a/users/narze/superduper.c b/users/narze/superduper.c new file mode 100644 index 000000000..b497ce2e6 --- /dev/null +++ b/users/narze/superduper.c | |||
| @@ -0,0 +1,66 @@ | |||
| 1 | #include "superduper.h" | ||
| 2 | #include "eeconfig.h" | ||
| 3 | #include "eeprom.h" | ||
| 4 | #include "keymap_colemak.h" | ||
| 5 | |||
| 6 | // SuperDuper | ||
| 7 | |||
| 8 | #define SUPERDUPER_COMBO_COUNT 3 | ||
| 9 | #define EECONFIG_SUPERDUPER_INDEX (uint8_t *) 19 | ||
| 10 | |||
| 11 | enum process_combo_event { | ||
| 12 | CB_SUPERDUPER, | ||
| 13 | }; | ||
| 14 | |||
| 15 | enum supported_layers { | ||
| 16 | _QWERTY, | ||
| 17 | _COLEMAK, | ||
| 18 | _QWOC | ||
| 19 | }; | ||
| 20 | |||
| 21 | const uint16_t PROGMEM superduper_combos[SUPERDUPER_COMBO_COUNT][3] = { | ||
| 22 | [_QWERTY] = {KC_S, KC_D, COMBO_END}, | ||
| 23 | [_COLEMAK] = {KC_R, KC_S, COMBO_END}, | ||
| 24 | [_QWOC] = {CM_S, CM_D, COMBO_END}, | ||
| 25 | }; | ||
| 26 | |||
| 27 | combo_t key_combos[COMBO_COUNT] = { | ||
| 28 | [CB_SUPERDUPER] = COMBO_ACTION(superduper_combos[_QWERTY]), | ||
| 29 | }; | ||
| 30 | |||
| 31 | volatile bool superduper_enabled = true; | ||
| 32 | |||
| 33 | const uint16_t PROGMEM empty_combo[] = {COMBO_END}; | ||
| 34 | |||
| 35 | bool toggle_superduper_mode(void) { | ||
| 36 | superduper_enabled = !superduper_enabled; | ||
| 37 | |||
| 38 | if (superduper_enabled) { | ||
| 39 | set_superduper_key_combos(); | ||
| 40 | } else { | ||
| 41 | clear_superduper_key_combos(); | ||
| 42 | } | ||
| 43 | |||
| 44 | return superduper_enabled; | ||
| 45 | } | ||
| 46 | |||
| 47 | void set_superduper_key_combo_layer(uint16_t layer) { | ||
| 48 | key_combos[CB_SUPERDUPER].keys = superduper_combos[layer]; | ||
| 49 | eeprom_update_byte(EECONFIG_SUPERDUPER_INDEX, layer); | ||
| 50 | } | ||
| 51 | |||
| 52 | void set_superduper_key_combos(void) { | ||
| 53 | uint8_t layer = eeprom_read_byte(EECONFIG_SUPERDUPER_INDEX); | ||
| 54 | |||
| 55 | switch (layer) { | ||
| 56 | case _QWERTY: | ||
| 57 | case _COLEMAK: | ||
| 58 | case _QWOC: | ||
| 59 | key_combos[CB_SUPERDUPER].keys = superduper_combos[layer]; | ||
| 60 | break; | ||
| 61 | } | ||
| 62 | } | ||
| 63 | |||
| 64 | void clear_superduper_key_combos(void) { | ||
| 65 | key_combos[CB_SUPERDUPER].keys = empty_combo; | ||
| 66 | } | ||
diff --git a/users/narze/superduper.h b/users/narze/superduper.h new file mode 100644 index 000000000..f8df2e1af --- /dev/null +++ b/users/narze/superduper.h | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | #pragma once | ||
| 2 | #include "narze.h" | ||
| 3 | |||
| 4 | bool toggle_superduper_mode(void); | ||
| 5 | void set_superduper_key_combo_layer(uint16_t layer); | ||
| 6 | void set_superduper_key_combos(void); | ||
| 7 | void clear_superduper_key_combos(void); | ||
