summaryrefslogtreecommitdiffstats
path: root/keyboards/splitkb/kyria/keymaps/pierrec83/encoders.c
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2021-07-25 18:18:39 -0700
committerGitHub <noreply@github.com>2021-07-25 18:18:39 -0700
commit4bb595f94b5c77e7a961ff69d2b4d9c53a9094fc (patch)
treeaef7208a8afee7f2f33c5a91b4613537c7ccb8ea /keyboards/splitkb/kyria/keymaps/pierrec83/encoders.c
parentd90897052243808863bcab3b07e16d5b6a0b08f0 (diff)
[Keyboard] Fix up SplitKB keyboards (#13511)
Diffstat (limited to 'keyboards/splitkb/kyria/keymaps/pierrec83/encoders.c')
-rw-r--r--keyboards/splitkb/kyria/keymaps/pierrec83/encoders.c64
1 files changed, 64 insertions, 0 deletions
diff --git a/keyboards/splitkb/kyria/keymaps/pierrec83/encoders.c b/keyboards/splitkb/kyria/keymaps/pierrec83/encoders.c
new file mode 100644
index 0000000000..7505925e72
--- /dev/null
+++ b/keyboards/splitkb/kyria/keymaps/pierrec83/encoders.c
@@ -0,0 +1,64 @@
+#include QMK_KEYBOARD_H
+#include "layers.h"
+
+#ifdef ENCODER_ENABLE
+
+bool 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;
+ }
+ }
+ return true;
+}
+#endif