summaryrefslogtreecommitdiffstats
path: root/users/gourdo1/gourdo1.c
diff options
context:
space:
mode:
authorQMK Bot <hello@qmk.fm>2022-08-13 16:24:37 +0000
committerQMK Bot <hello@qmk.fm>2022-08-13 16:24:37 +0000
commita03849c92cf654cb196afc4acd987b31681a4529 (patch)
tree145df25987a6c71d50b038ee343d355084671c91 /users/gourdo1/gourdo1.c
parent149db3c6a8c4eecfc280e64c8c8ed0197a123242 (diff)
parent4c6ce12d2a671b4e4270648989b7c74ac2876882 (diff)
Merge remote-tracking branch 'origin/master' into develop
Diffstat (limited to 'users/gourdo1/gourdo1.c')
-rw-r--r--users/gourdo1/gourdo1.c121
1 files changed, 61 insertions, 60 deletions
diff --git a/users/gourdo1/gourdo1.c b/users/gourdo1/gourdo1.c
index 51f774061e..26ecd8c1c0 100644
--- a/users/gourdo1/gourdo1.c
+++ b/users/gourdo1/gourdo1.c
@@ -21,33 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "custom_double_taps.h"
-// Tap once for shift, twice for Caps Lock but only if Win Key is not disabled (also disabled by user.config variable)
-void dance_LSFT_each_tap(qk_tap_dance_state_t * state, void * user_data) {
- if (user_config.double_tap_shift_for_capslock) {
- if (state -> count == 1 || keymap_config.no_gui) {
- register_code(KC_LSFT);
- } else {
- register_code(KC_CAPS);
- }
- } else {
- register_code(KC_LSFT);
- }
-}
-
-void dance_LSFT_reset(qk_tap_dance_state_t * state, void * user_data) {
- if (state -> count == 1 || keymap_config.no_gui) {
- unregister_code(KC_LSFT);
- } else {
- unregister_code(KC_CAPS);
- unregister_code(KC_LSFT);
- }
-}
-
-// Tap Dance definitions
-qk_tap_dance_action_t tap_dance_actions[] = {
- // Tap once for shift, twice for Caps Lock
- [TD_LSFT_CAPS_WIN] = ACTION_TAP_DANCE_FN_ADVANCED(dance_LSFT_each_tap, NULL, dance_LSFT_reset)
-};
+#include "autocorrect/autocorrection.h"
// RGB NIGHT MODE
#ifdef RGB_MATRIX_ENABLE
@@ -129,6 +103,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t * record) {
if (!process_record_keymap(keycode, record)) { return false; }
if (!process_capsnum(keycode, record)) { return false; }
if (!process_esc_to_base(keycode, record)) { return false; }
+ if (!process_lsft_for_caps(keycode, record)) { return false; }
+ if (!process_autocorrection(keycode, record)) { return false; }
// Key macros ...
switch (keycode) {
@@ -136,66 +112,77 @@ bool process_record_user(uint16_t keycode, keyrecord_t * record) {
// User configuration toggles
case PRNCONF: // Print verbose status of all user_config toggles (open a text editor before engaging!!)
if (record->event.pressed) {
- //send_string("Left bracket with alt numcodes "SS_LALT(SS_TAP(X_KP_0) SS_TAP(X_KP_0) SS_TAP(X_KP_9) SS_TAP(X_KP_1))"\n");
- send_string("\n\x2D\x2D\x2D\x2D\x2D\x2D\x2D\x2D\x2D\x3C\x3C\x3C\x3C\x3C\x3C\x3C\x3C\x3C");
- send_string(" gourdo1\x27s GMMK Pro User Settings ");
- send_string("\x3E\x3E\x3E\x3E\x3E\x3E\x3E\x3E\x3E\x2D\x2D\x2D\x2D\x2D\x2D\x2D\x2D\x2D\n");
- send_string("Hold \x5B \bFn\x5D and the number corresponding to a setting below to toggle.\n");
- send_string("Re-print this screen with \x5B \bFn\x5D \x5B`\x5D to see your changes reflected.\n");
- send_string("Config also visible as RGB under number keys by holding \x5B \bFn\x5D.\n");
- send_string("\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d");
- send_string("\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d");
- send_string("\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d");
- send_string("\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\n");
+ send_string("\n"SS_TAP(X_KP_MINUS)SS_TAP(X_KP_MINUS)SS_TAP(X_KP_MINUS)SS_TAP(X_KP_MINUS)SS_TAP(X_KP_MINUS)SS_TAP(X_KP_MINUS)SS_TAP(X_KP_MINUS)SS_TAP(X_KP_MINUS)SS_TAP(X_KP_MINUS)"#########");
+ send_string(" gourdo1" SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_3)SS_TAP(X_KP_9))"s GMMK Pro User Settings ");
+ send_string("#########"SS_TAP(X_KP_MINUS)SS_TAP(X_KP_MINUS)SS_TAP(X_KP_MINUS)SS_TAP(X_KP_MINUS)SS_TAP(X_KP_MINUS)SS_TAP(X_KP_MINUS)SS_TAP(X_KP_MINUS)SS_TAP(X_KP_MINUS)SS_TAP(X_KP_MINUS)"\n");
+ send_string("Hold "SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_1))"Fn"SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_3))" and the number corresponding to a setting below to toggle.\n");
+ send_string("Re"SS_TAP(X_KP_MINUS)"print this screen with "SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_1))"Fn" SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_3)) SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_1))"`" SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_3))" to see your changes reflected.\n");
+ send_string("Config also visible as RGB under number keys by holding "SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_1))"Fn" SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_K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KP_MINUS)SS_TAP(X_KP_MINUS));
+ send_string(SS_TAP(X_KP_MINUS)SS_TAP(X_KP_MINUS)SS_TAP(X_KP_MINUS)SS_TAP(X_KP_MINUS)SS_TAP(X_KP_MINUS)SS_TAP(X_KP_MINUS)SS_TAP(X_KP_MINUS)SS_TAP(X_KP_MINUS)SS_TAP(X_KP_MINUS)SS_TAP(X_KP_MINUS)"\n");
send_string("1. CapsLock RGB highlight alpha keys................ ");
if (user_config.rgb_hilite_caps) {
- send_string("\x5BON\x5D\n");
+ send_string(SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_1))"ON" SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_3))"\n");
} else {
- send_string("\x5BOFF\x5D\n");
+ send_string(SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_1))"OFF" SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_3))"\n");
}
send_string("2. Numpad RGB highlight layer keys.................. ");
if (user_config.rgb_hilite_numpad) {
- send_string("\x5BON\x5D\n");
+ send_string(SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_1))"ON" SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_3))"\n");
} else {
- send_string("\x5BOFF\x5D\n");
+ send_string(SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_1))"OFF" SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_3))"\n");
}
send_string("3. Double tap ESC to revert to BASE layer........... ");
if (user_config.esc_double_tap_to_baselyr) {
- send_string("\x5BON\x5D\n");
+ send_string(SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_1))"ON" SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_3))"\n");
} else {
- send_string("\x5BOFF\x5D\n");
+ send_string(SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_1))"OFF" SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_3))"\n");
}
- send_string("4. DEL \x26 HOME key locations......................... ");
+ send_string("4. DEL "SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_3)SS_TAP(X_KP_8))" HOME key locations......................... ");
if (user_config.del_right_home_top) {
- send_string("\x5BHOME on F13\x3B DEL right of BKSPC\x5D\n");
+ send_string(SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_1))"HOME on F13"SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_5)SS_TAP(X_KP_9))" DEL right of BKSPC" SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_3))"\n");
} else {
- send_string("\x5B \bDEL on F13\x3B HOME right of BKSPC\x5D\n");
+ send_string(SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_1))"DEL on F13"SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_5)SS_TAP(X_KP_9))" HOME right of BKSPC" SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_3))"\n");
}
- send_string("5. Numpad on CapsLock\x3B double tap LSHIFT for Caps... ");
+ send_string("5. Numpad on CapsLock"SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_5)SS_TAP(X_KP_9))" double tap LSHIFT for Caps... ");
if (user_config.double_tap_shift_for_capslock) {
- send_string("\x5BON\x5D\n");
+ send_string(SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_1))"ON" SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_3))"\n");
} else {
- send_string("\x5BOFF\x5D\n");
+ send_string(SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_1))"OFF" SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_3))"\n");
}
send_string("6. Encoder button function.......................... ");
if (user_config.encoder_press_mute_or_media) {
- send_string("\x5BMUTE\x5D\n");
+ send_string(SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_1))"MUTE" SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_3))"\n");
} else {
- send_string("\x5BMEDIA PLAY\x2FPAUSE\x5D\n");
+ send_string(SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_1))"MEDIA PLAY"SS_TAP(X_KP_SLASH) "PAUSE" SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_3))"\n");
}
send_string("7. Insert function accessed with.................... ");
if (user_config.ins_on_shft_bkspc_or_del) {
- send_string("\x5BSHIFT\x2D \bBKSPC\x5D\n");
+ send_string(SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_1))"SHIFT"SS_TAP(X_KP_MINUS)"BKSPC"SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_3))"\n");
} else {
- send_string("\x5BSHIFT\x2D \bDEL\x5D\n");
+ send_string(SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_1))"SHIFT"SS_TAP(X_KP_MINUS)"DEL"SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_3))"\n");
}
- send_string("8. Force SHIFT \x26 CTRL\x2DSPACE to function like SPACE.. ");
+ send_string("8. Force SHIFT "SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_3)SS_TAP(X_KP_8))" CTRL"SS_TAP(X_KP_MINUS)"SPACE to function like SPACE.. ");
if (user_config.disable_space_mods) {
- send_string("\x5BON\x5D\n");
+ send_string(SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_1))"ON"SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_3))"\n");
+ } else {
+ send_string(SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_1))"OFF"SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_3))"\n");
+ }
+ send_string("9. AutoCorrect...................................... ");
+ if (user_config.autocorrect) {
+ send_string(SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_1))"ON"SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_3))"\n");
} else {
- send_string("\x5BOFF\x5D\n");
+ send_string(SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_1))"OFF"SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_3))"\n");
}
- send_string("\nThe latest firmware updates are always here\x3a https\x3a\x2F\x2Fgithub.com\x2Fgourdo1\x2Fgmmkpro\x2Dmedia\n");
+ send_string("0. CapsLock highlights extended alphas "SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_4)SS_TAP(X_KP_0))"ISO"SS_TAP(X_KP_MINUS)"only"SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_4)SS_TAP(X_KP_1))"... ");
+ if (user_config.rgb_english_caps) {
+ send_string(SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_1))"OFF"SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_3))"\n");
+ } else {
+ send_string(SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_1))"ON"SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_9)SS_TAP(X_KP_3))"\n");
+ }
+ send_string("\nThe latest firmware updates are always here"SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_5)SS_TAP(X_KP_8))" https" SS_LALT(SS_TAP(X_KP_0)SS_TAP(X_KP_0)SS_TAP(X_KP_5)SS_TAP(X_KP_8))SS_TAP(X_KP_SLASH)SS_TAP(X_KP_SLASH) "github.com"SS_TAP(X_KP_SLASH) "gourdo1"SS_TAP(X_KP_SLASH)"gmmkpro"SS_TAP(X_KP_MINUS)"media\n");
}
break;
@@ -247,6 +234,18 @@ bool process_record_user(uint16_t keycode, keyrecord_t * record) {
eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM
}
break;
+ case TG_AUTOCR: // Toggle AutoCorrect
+ if (record->event.pressed) {
+ user_config.autocorrect ^= 1; // Toggles the status
+ eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM
+ }
+ break;
+ case TG_ENGCAP: // Toggle highlighting Non-English letters during CAPSLOCK
+ if (record->event.pressed) {
+ user_config.rgb_english_caps ^= 1; // Toggles the status
+ eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM
+ }
+ break;
//return false;
// Key to the left of encoder function (default HOME)
@@ -417,7 +416,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t * record) {
case KC_00:
if (record -> event.pressed) {
// when keycode KC_00 is pressed
- send_string("00");
+ send_string(SS_TAP(X_KP_0)SS_TAP(X_KP_0));
} else unregister_code16(keycode);
break;
@@ -572,7 +571,7 @@ bool caps_word_press_user(uint16_t keycode) {
case KC_DQT:
case KC_COLN:
case KC_RSFT:
- case LSFTCAPSWIN:
+ case KC_LSFT:
add_weak_mods(MOD_BIT(KC_LSFT)); // Apply shift to next key.
return true;
@@ -625,6 +624,8 @@ void eeconfig_init_user(void) {
user_config.esc_double_tap_to_baselyr = true;
user_config.ins_on_shft_bkspc_or_del = true;
user_config.disable_space_mods = true;
+ user_config.autocorrect = true;
+ user_config.rgb_english_caps = true;
eeconfig_update_user(user_config.raw);
}