diff options
Diffstat (limited to 'keyboards/keebio/quefrency/keymaps/jonavin/keymap.c')
-rw-r--r-- | keyboards/keebio/quefrency/keymaps/jonavin/keymap.c | 55 |
1 files changed, 20 insertions, 35 deletions
diff --git a/keyboards/keebio/quefrency/keymaps/jonavin/keymap.c b/keyboards/keebio/quefrency/keymaps/jonavin/keymap.c index 721148f4d..415f554e2 100644 --- a/keyboards/keebio/quefrency/keymaps/jonavin/keymap.c +++ b/keyboards/keebio/quefrency/keymaps/jonavin/keymap.c | |||
@@ -57,46 +57,31 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { | |||
57 | }; | 57 | }; |
58 | 58 | ||
59 | #ifdef ENCODER_ENABLE // Encoder Functionality | 59 | #ifdef ENCODER_ENABLE // Encoder Functionality |
60 | bool encoder_update_user(uint8_t index, bool clockwise) { | 60 | bool encoder_update_user(uint8_t index, bool clockwise) { |
61 | switch (index) | 61 | uint8_t mods_state = get_mods(); |
62 | { | 62 | switch (index) { |
63 | case 0: // first encoder (Left Macro set) | 63 | case 0: // first encoder (Left Macro set) |
64 | if (clockwise) { | 64 | encoder_action_navpage(clockwise); |
65 | tap_code(KC_PGDN); | 65 | break; |
66 | } else { | ||
67 | tap_code(KC_PGUP); | ||
68 | } | ||
69 | 66 | ||
70 | default: // other encoder (Top right) | 67 | default: // other encoder (Top right) |
71 | if ( clockwise ) { | 68 | if (mods_state & MOD_BIT(KC_LSFT) ) { // If you are holding Left shift, change layers |
72 | if (keyboard_report->mods & MOD_BIT(KC_LSFT) ) { // If you are holding L shift, Page up | 69 | encoder_action_layerchange(clockwise); |
73 | unregister_mods(MOD_BIT(KC_LSFT)); | 70 | } else if (mods_state & MOD_BIT(KC_RSFT) ) { // If you are holding Right shift, Page up |
74 | register_code(KC_PGDN); | 71 | unregister_mods(MOD_BIT(KC_RSFT)); |
75 | register_mods(MOD_BIT(KC_LSFT)); | 72 | encoder_action_navpage(clockwise); |
76 | } else if (keyboard_report->mods & MOD_BIT(KC_LCTL)) { // if holding Left Ctrl, navigate next word | 73 | register_mods(MOD_BIT(KC_RSFT)); |
77 | tap_code16(LCTL(KC_RGHT)); | 74 | } else if (mods_state & MOD_BIT(KC_LCTL)) { // if holding Left Ctrl, navigate next/prev word |
78 | } else if (keyboard_report->mods & MOD_BIT(KC_LALT)) { // if holding Left Alt, change media next track | 75 | encoder_action_navword(clockwise); |
79 | tap_code(KC_MEDIA_NEXT_TRACK); | 76 | } else if (mods_state & MOD_BIT(KC_LALT)) { // if holding Left Alt, change media next/prev track |
77 | encoder_action_mediatrack(clockwise); | ||
80 | } else { | 78 | } else { |
81 | tap_code(KC_VOLU); // Otherwise it just changes volume | 79 | encoder_action_volume(clockwise); // Otherwise it just changes volume |
82 | } | ||
83 | } else { | ||
84 | if (keyboard_report->mods & MOD_BIT(KC_LSFT) ) { | ||
85 | unregister_mods(MOD_BIT(KC_LSFT)); | ||
86 | register_code(KC_PGUP); | ||
87 | register_mods(MOD_BIT(KC_LSFT)); | ||
88 | } else if (keyboard_report->mods & MOD_BIT(KC_LCTL)) { // if holding Left Ctrl, navigate previous word | ||
89 | tap_code16(LCTL(KC_LEFT)); | ||
90 | } else if (keyboard_report->mods & MOD_BIT(KC_LALT)) { // if holding Left Alt, change media previous track | ||
91 | tap_code(KC_MEDIA_PREV_TRACK); | ||
92 | } else { | ||
93 | tap_code(KC_VOLD); | ||
94 | } | 80 | } |
81 | break; | ||
95 | } | 82 | } |
96 | break; | 83 | return true; |
97 | } | 84 | } |
98 | return true; | ||
99 | } | ||
100 | #endif | 85 | #endif |
101 | 86 | ||
102 | #ifdef RGBLIGHT_ENABLE | 87 | #ifdef RGBLIGHT_ENABLE |