summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Verst <github@verst.eu>2021-04-19 11:22:49 +0200
committerGitHub <noreply@github.com>2021-04-19 02:22:49 -0700
commit2274631c8fd4fb6b20f6dc9e571dfb43625f629e (patch)
tree7b5553a1e53aa4e679537471fa909f0edd80a5eb
parent81be065fa538c5978363d379302b069ba23860aa (diff)
downloadqmk_firmware-2274631c8fd4fb6b20f6dc9e571dfb43625f629e.tar.gz
qmk_firmware-2274631c8fd4fb6b20f6dc9e571dfb43625f629e.zip
[Keymap] Fix handling of RV_LOCK and RV_SNAP for windows (#12498)
Co-authored-by: Robert Verst <robert.verst@tobit.com>
-rw-r--r--users/rverst/rverst.c39
1 files changed, 7 insertions, 32 deletions
diff --git a/users/rverst/rverst.c b/users/rverst/rverst.c
index 0524c6011d..23391caa6a 100644
--- a/users/rverst/rverst.c
+++ b/users/rverst/rverst.c
@@ -197,15 +197,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
// Lock computer
case RV_LOCK:
if (mode == MAC || mode == MAC_UNI) {
- register_code(KC_LGUI);
- register_code(KC_LCTL);
- tap_code(KC_Q);
- unregister_code(KC_LCTL);
- unregister_code(KC_LGUI);
+ tap_code16(G(C(KC_Q)));
} else if (mode == WINDOWS || mode == WINDOWS_UNI) {
- register_code(KC_LGUI);
- tap_code(KC_L);
- register_code(KC_LGUI);
+ tap_code16(G(KC_L));
}
return false;
@@ -215,23 +209,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (ls) unregister_code(KC_LSFT);
if (rs) unregister_code(KC_RSFT);
- register_code(KC_LGUI);
- register_code(KC_LSFT);
- if (as)
- tap_code(KC_5);
- else
- tap_code(KC_4);
- unregister_code(KC_LSFT);
- unregister_code(KC_LGUI);
+ tap_code16(G(S(as ? KC_4 : KC_5)));
if (ls) register_code(KC_LSFT);
if (rs) register_code(KC_RSFT);
} else if (mode == WINDOWS || mode == WINDOWS_UNI) {
- register_code(KC_LGUI);
- register_code(KC_LSFT);
- tap_code(KC_S);
- register_code(KC_LSFT);
- register_code(KC_LGUI);
+ tap_code16(G(S(KC_S)));
}
return false;
@@ -260,9 +243,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (ls) unregister_code(KC_LSFT);
if (rs) unregister_code(KC_RSFT);
- register_code(KC_LALT);
- tap_code(KC_U);
- unregister_code(KC_LALT);
+ tap_code16(A(KC_U));
if (as) register_code(KC_LSFT);
if (keycode == RV_AUML) {
@@ -318,11 +299,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (is_unicode(mode)) {
send_unicode_string("€");
} else if (mode == MAC) {
- register_code(KC_LALT);
- register_code(KC_LSFT);
- tap_code(KC_2);
- unregister_code(KC_LSFT);
- unregister_code(KC_LALT);
+ tap_code16(S(A(KC_2)));
} else if (mode == WINDOWS) {
register_code(KC_RALT);
tap_code(KC_0);
@@ -343,9 +320,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
send_unicode_string("ß");
}
} else if (mode == MAC) {
- register_code(KC_LALT);
- tap_code(KC_S);
- unregister_code(KC_LALT);
+ tap_code16(A(KC_S));
} else if (mode == WINDOWS) {
register_code(KC_RALT);
tap_code(KC_2);