Fix use of shifted custom keycode (#18978)

This commit is contained in:
Joel Challis 2022-11-06 23:48:31 +00:00 committed by GitHub
parent a7b2f4233c
commit 442e7653cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,7 +30,8 @@ enum layer {
enum custom_keycodes { enum custom_keycodes {
RGBRST = SAFE_RANGE, RGBRST = SAFE_RANGE,
KC_00, KC_00,
ALTAB ALTAB,
SALTAB
}; };
#define CALC LT(_CALC, KC_ESC) #define CALC LT(_CALC, KC_ESC)
#define CUSL LT(_CURSOL, KC_TAB) #define CUSL LT(_CURSOL, KC_TAB)
@ -71,7 +72,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_CURSOL] = LAYOUT( [_CURSOL] = LAYOUT(
QK_BOOT , KC_F1, KC_F2, KC_PGUP, KC_F4, KC_F5, KC_F6, KC_F7, KC_UP, KC_F9, KC_F10, QK_BOOT, QK_BOOT , KC_F1, KC_F2, KC_PGUP, KC_F4, KC_F5, KC_F6, KC_F7, KC_UP, KC_F9, KC_F10, QK_BOOT,
_______, KC_TILD, KC_HOME, KC_PGDN, KC_END, KC_LPRN, KC_RPRN, KC_LEFT, KC_DOWN, KC_RGHT, KC_PIPE, KC_F11, _______, KC_TILD, KC_HOME, KC_PGDN, KC_END, KC_LPRN, KC_RPRN, KC_LEFT, KC_DOWN, KC_RGHT, KC_PIPE, KC_F11,
_______, KC_GRV, C(KC_LEFT), KC_F3, C(KC_RGHT), S(ALTAB), ALTAB, LCA(KC_LEFT), KC_F8, LCA(KC_RGHT), KC_BSLS, RGBRST, _______, KC_GRV, C(KC_LEFT), KC_F3, C(KC_RGHT), SALTAB, ALTAB, LCA(KC_LEFT), KC_F8, LCA(KC_RGHT), KC_BSLS, RGBRST,
_______, _______, C(KC_SPC), MO(_ADJUST), _______, _______, _______, _______ _______, _______, C(KC_SPC), MO(_ADJUST), _______, _______, _______, _______
), ),
@ -163,20 +164,20 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
} }
return false; return false;
break; break;
case S(ALTAB): case SALTAB:
case ALTAB: case ALTAB:
if (record->event.pressed) { if (record->event.pressed) {
if (!alt_pressed) { if (!alt_pressed) {
alt_pressed = true; alt_pressed = true;
register_code(KC_LALT); register_code(KC_LALT);
} }
if (keycode == S(ALTAB)) { if (keycode == SALTAB) {
register_code(KC_LSFT); register_code(KC_LSFT);
} }
register_code(KC_TAB); register_code(KC_TAB);
} else { } else {
unregister_code(KC_TAB); unregister_code(KC_TAB);
if (keycode == S(ALTAB)) { if (keycode == SALTAB) {
unregister_code(KC_LSFT); unregister_code(KC_LSFT);
} }
} }