Created
June 20, 2021 17:13
-
-
Save rootiest/9a36e81c6aa86bf6445424ce6a88834e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool encoder_update_user(uint8_t index, bool clockwise) { | |
if (index == 0) { /* First encoder */ | |
switch (biton32(layer_state)) { | |
case 0: | |
if ((get_mods() & MOD_MASK_SHIFT)) { // Shifted | |
const uint8_t _real_mods = get_mods(); | |
unregister_code16(KC_LSFT); | |
unregister_code16(KC_RSFT); | |
if (clockwise) { | |
tap_code16(KC_WH_D); | |
} else { | |
tap_code16(KC_WH_U); | |
} | |
set_mods(_real_mods); | |
return false; | |
break; | |
} | |
} | |
} | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment