diff options
author | Pierre Chevalier <pierrechevalier83@gmail.com> | 2020-06-18 06:18:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-17 22:18:16 -0700 |
commit | 43b6f031b184432eba647f04bc69ced72ee2dd08 (patch) | |
tree | 54ac8cd89f4bef451a5258190153d4616d01a670 /keyboards/kyria/keymaps/pierrec83/encoders.c | |
parent | 3e27ceee4220a56ec35d5567773cf9cda4b22842 (diff) | |
download | qmk_firmware-43b6f031b184432eba647f04bc69ced72ee2dd08.tar.gz |
[Keymap] Add pierrec83's Kyria keymap (#9401)
Diffstat (limited to 'keyboards/kyria/keymaps/pierrec83/encoders.c')
-rw-r--r-- | keyboards/kyria/keymaps/pierrec83/encoders.c | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/keyboards/kyria/keymaps/pierrec83/encoders.c b/keyboards/kyria/keymaps/pierrec83/encoders.c new file mode 100644 index 000000000..2497b9eb7 --- /dev/null +++ b/keyboards/kyria/keymaps/pierrec83/encoders.c @@ -0,0 +1,63 @@ +#include QMK_KEYBOARD_H +#include "layers.h" + +#ifdef ENCODER_ENABLE + +void encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { + switch (get_highest_layer(layer_state)) { + case WORKMAN: + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + break; + case SYMBOLS: + case FN: + if (clockwise) { + tap_code(KC_PGDN); + } else { + tap_code(KC_PGUP); + } + break; + case NAV: + case RNAV: + default: + if (clockwise) { + tap_code16(C(A(KC_RIGHT))); + } else { + tap_code16(C(A(KC_LEFT))); + } + break; + } + } else if (index == 1) { + switch (get_highest_layer(layer_state)) { + case WORKMAN: + if (clockwise) { + tap_code(KC_BRIU); + } else { + tap_code(KC_BRID); + } + break; + case SYMBOLS: + case FN: + if (clockwise) { + tap_code16(C(KC_RIGHT)); + } else { + tap_code16(C(KC_LEFT)); + } + break; + case NAV: + case RNAV: + default: + if (clockwise) { + tap_code16(C(KC_TAB)); + } else { + tap_code16(C(S(KC_TAB))); + } + break; + } + } +} +#endif |