summaryrefslogtreecommitdiff
path: root/keyboards/keebio
diff options
context:
space:
mode:
authorQMK Bot <hello@qmk.fm>2021-09-28 19:24:40 +0000
committerQMK Bot <hello@qmk.fm>2021-09-28 19:24:40 +0000
commitbc41d37bafefc098d36eabafdc8f4c23af188c34 (patch)
treebf08da39937c9cd1f0d018c2c7c87fda521f9bc4 /keyboards/keebio
parentf89620d7af11f4f7e155ae7f015281d2526bbe46 (diff)
parent705cd433c22aad00b12183eaa3bada50d90fd97b (diff)
Merge remote-tracking branch 'origin/master' into develop
Diffstat (limited to 'keyboards/keebio')
-rw-r--r--keyboards/keebio/quefrency/keymaps/jonavin/keymap.c55
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 721148f4dc..415f554e26 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) {
};
#ifdef ENCODER_ENABLE // Encoder Functionality
-bool encoder_update_user(uint8_t index, bool clockwise) {
- switch (index)
- {
- case 0: // first encoder (Left Macro set)
- if (clockwise) {
- tap_code(KC_PGDN);
- } else {
- tap_code(KC_PGUP);
- }
+ bool encoder_update_user(uint8_t index, bool clockwise) {
+ uint8_t mods_state = get_mods();
+ switch (index) {
+ case 0: // first encoder (Left Macro set)
+ encoder_action_navpage(clockwise);
+ break;
- default: // other encoder (Top right)
- if ( clockwise ) {
- if (keyboard_report->mods & MOD_BIT(KC_LSFT) ) { // If you are holding L shift, Page up
- unregister_mods(MOD_BIT(KC_LSFT));
- register_code(KC_PGDN);
- register_mods(MOD_BIT(KC_LSFT));
- } else if (keyboard_report->mods & MOD_BIT(KC_LCTL)) { // if holding Left Ctrl, navigate next word
- tap_code16(LCTL(KC_RGHT));
- } else if (keyboard_report->mods & MOD_BIT(KC_LALT)) { // if holding Left Alt, change media next track
- tap_code(KC_MEDIA_NEXT_TRACK);
+ default: // other encoder (Top right)
+ if (mods_state & MOD_BIT(KC_LSFT) ) { // If you are holding Left shift, change layers
+ encoder_action_layerchange(clockwise);
+ } else if (mods_state & MOD_BIT(KC_RSFT) ) { // If you are holding Right shift, Page up
+ unregister_mods(MOD_BIT(KC_RSFT));
+ encoder_action_navpage(clockwise);
+ register_mods(MOD_BIT(KC_RSFT));
+ } else if (mods_state & MOD_BIT(KC_LCTL)) { // if holding Left Ctrl, navigate next/prev word
+ encoder_action_navword(clockwise);
+ } else if (mods_state & MOD_BIT(KC_LALT)) { // if holding Left Alt, change media next/prev track
+ encoder_action_mediatrack(clockwise);
} else {
- tap_code(KC_VOLU); // Otherwise it just changes volume
- }
- } else {
- if (keyboard_report->mods & MOD_BIT(KC_LSFT) ) {
- unregister_mods(MOD_BIT(KC_LSFT));
- register_code(KC_PGUP);
- register_mods(MOD_BIT(KC_LSFT));
- } else if (keyboard_report->mods & MOD_BIT(KC_LCTL)) { // if holding Left Ctrl, navigate previous word
- tap_code16(LCTL(KC_LEFT));
- } else if (keyboard_report->mods & MOD_BIT(KC_LALT)) { // if holding Left Alt, change media previous track
- tap_code(KC_MEDIA_PREV_TRACK);
- } else {
- tap_code(KC_VOLD);
+ encoder_action_volume(clockwise); // Otherwise it just changes volume
}
+ break;
}
- break;
+ return true;
}
- return true;
-}
#endif
#ifdef RGBLIGHT_ENABLE