diff options
| author | Robert Verst <github@verst.eu> | 2021-04-19 11:22:49 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-19 02:22:49 -0700 |
| commit | 2274631c8fd4fb6b20f6dc9e571dfb43625f629e (patch) | |
| tree | 7b5553a1e53aa4e679537471fa909f0edd80a5eb /users/rverst | |
| parent | 81be065fa538c5978363d379302b069ba23860aa (diff) | |
| download | qmk_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>
Diffstat (limited to 'users/rverst')
| -rw-r--r-- | users/rverst/rverst.c | 39 |
1 files changed, 7 insertions, 32 deletions
diff --git a/users/rverst/rverst.c b/users/rverst/rverst.c index 0524c6011..23391caa6 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) { | |||
| 197 | // Lock computer | 197 | // Lock computer |
| 198 | case RV_LOCK: | 198 | case RV_LOCK: |
| 199 | if (mode == MAC || mode == MAC_UNI) { | 199 | if (mode == MAC || mode == MAC_UNI) { |
| 200 | register_code(KC_LGUI); | 200 | tap_code16(G(C(KC_Q))); |
| 201 | register_code(KC_LCTL); | ||
| 202 | tap_code(KC_Q); | ||
| 203 | unregister_code(KC_LCTL); | ||
| 204 | unregister_code(KC_LGUI); | ||
| 205 | } else if (mode == WINDOWS || mode == WINDOWS_UNI) { | 201 | } else if (mode == WINDOWS || mode == WINDOWS_UNI) { |
| 206 | register_code(KC_LGUI); | 202 | tap_code16(G(KC_L)); |
| 207 | tap_code(KC_L); | ||
| 208 | register_code(KC_LGUI); | ||
| 209 | } | 203 | } |
| 210 | return false; | 204 | return false; |
| 211 | 205 | ||
| @@ -215,23 +209,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
| 215 | if (ls) unregister_code(KC_LSFT); | 209 | if (ls) unregister_code(KC_LSFT); |
| 216 | if (rs) unregister_code(KC_RSFT); | 210 | if (rs) unregister_code(KC_RSFT); |
| 217 | 211 | ||
| 218 | register_code(KC_LGUI); | 212 | tap_code16(G(S(as ? KC_4 : KC_5))); |
| 219 | register_code(KC_LSFT); | ||
| 220 | if (as) | ||
| 221 | tap_code(KC_5); | ||
| 222 | else | ||
| 223 | tap_code(KC_4); | ||
| 224 | unregister_code(KC_LSFT); | ||
| 225 | unregister_code(KC_LGUI); | ||
| 226 | 213 | ||
| 227 | if (ls) register_code(KC_LSFT); | 214 | if (ls) register_code(KC_LSFT); |
| 228 | if (rs) register_code(KC_RSFT); | 215 | if (rs) register_code(KC_RSFT); |
| 229 | } else if (mode == WINDOWS || mode == WINDOWS_UNI) { | 216 | } else if (mode == WINDOWS || mode == WINDOWS_UNI) { |
| 230 | register_code(KC_LGUI); | 217 | tap_code16(G(S(KC_S))); |
| 231 | register_code(KC_LSFT); | ||
| 232 | tap_code(KC_S); | ||
| 233 | register_code(KC_LSFT); | ||
| 234 | register_code(KC_LGUI); | ||
| 235 | } | 218 | } |
| 236 | return false; | 219 | return false; |
| 237 | 220 | ||
| @@ -260,9 +243,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
| 260 | if (ls) unregister_code(KC_LSFT); | 243 | if (ls) unregister_code(KC_LSFT); |
| 261 | if (rs) unregister_code(KC_RSFT); | 244 | if (rs) unregister_code(KC_RSFT); |
| 262 | 245 | ||
| 263 | register_code(KC_LALT); | 246 | tap_code16(A(KC_U)); |
| 264 | tap_code(KC_U); | ||
| 265 | unregister_code(KC_LALT); | ||
| 266 | 247 | ||
| 267 | if (as) register_code(KC_LSFT); | 248 | if (as) register_code(KC_LSFT); |
| 268 | if (keycode == RV_AUML) { | 249 | if (keycode == RV_AUML) { |
| @@ -318,11 +299,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
| 318 | if (is_unicode(mode)) { | 299 | if (is_unicode(mode)) { |
| 319 | send_unicode_string("€"); | 300 | send_unicode_string("€"); |
| 320 | } else if (mode == MAC) { | 301 | } else if (mode == MAC) { |
| 321 | register_code(KC_LALT); | 302 | tap_code16(S(A(KC_2))); |
| 322 | register_code(KC_LSFT); | ||
| 323 | tap_code(KC_2); | ||
| 324 | unregister_code(KC_LSFT); | ||
| 325 | unregister_code(KC_LALT); | ||
| 326 | } else if (mode == WINDOWS) { | 303 | } else if (mode == WINDOWS) { |
| 327 | register_code(KC_RALT); | 304 | register_code(KC_RALT); |
| 328 | tap_code(KC_0); | 305 | tap_code(KC_0); |
| @@ -343,9 +320,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
| 343 | send_unicode_string("ß"); | 320 | send_unicode_string("ß"); |
| 344 | } | 321 | } |
| 345 | } else if (mode == MAC) { | 322 | } else if (mode == MAC) { |
| 346 | register_code(KC_LALT); | 323 | tap_code16(A(KC_S)); |
| 347 | tap_code(KC_S); | ||
| 348 | unregister_code(KC_LALT); | ||
| 349 | } else if (mode == WINDOWS) { | 324 | } else if (mode == WINDOWS) { |
| 350 | register_code(KC_RALT); | 325 | register_code(KC_RALT); |
| 351 | tap_code(KC_2); | 326 | tap_code(KC_2); |
