summaryrefslogtreecommitdiff
path: root/keyboards/kyria/keymaps/gotham/encoder_utils.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/kyria/keymaps/gotham/encoder_utils.c
parentd90897052243808863bcab3b07e16d5b6a0b08f0 (diff)
downloadqmk_firmware-4bb595f94b5c77e7a961ff69d2b4d9c53a9094fc.tar.gz
qmk_firmware-4bb595f94b5c77e7a961ff69d2b4d9c53a9094fc.zip
[Keyboard] Fix up SplitKB keyboards (#13511)
Diffstat (limited to 'keyboards/kyria/keymaps/gotham/encoder_utils.c')
-rw-r--r--keyboards/kyria/keymaps/gotham/encoder_utils.c94
1 files changed, 0 insertions, 94 deletions
diff --git a/keyboards/kyria/keymaps/gotham/encoder_utils.c b/keyboards/kyria/keymaps/gotham/encoder_utils.c
deleted file mode 100644
index 1c2962339d..0000000000
--- a/keyboards/kyria/keymaps/gotham/encoder_utils.c
+++ /dev/null
@@ -1,94 +0,0 @@
-#include "encoder_utils.h"
-
-void encoder_utils_init(void) {
- encoder_left_mode = ENC_MODE_VOLUME;
- encoder_right_mode = ENC_MODE_LEFT_RIGHT;
-}
-
-void set_encoder_mode(bool left, encoder_mode_t mode) {
- if (left) {
- encoder_left_mode = mode;
- } else {
- encoder_right_mode = mode;
- }
-}
-
-encoder_mode_t get_encoder_mode(bool left) {
- if (left) {
- return encoder_left_mode;
- } else {
- return encoder_right_mode;
- }
-}
-
-void cycle_encoder_mode(bool left, bool reverse) {
- encoder_mode_t mode = get_encoder_mode(left);
- if (reverse) {
- mode = (mode == 0) ? (_ENC_MODE_LAST - 1) : (mode - 1);
- } else {
- mode = (mode == (_ENC_MODE_LAST - 1)) ? 0 : (mode + 1);
- }
- set_encoder_mode(left, mode);
-}
-
-void encoder_action_volume(uint8_t clockwise) {
- if (clockwise) {
- tap_code(KC_VOLU);
- } else {
- tap_code(KC_VOLD);
- }
-}
-
-void encoder_action_word_nav(uint8_t clockwise) {
- if (clockwise) {
- tap_code16(C(KC_RIGHT));
- } else {
- tap_code16(C(KC_LEFT));
- }
-}
-
-void encoder_action_left_right(uint8_t clockwise) {
- if (clockwise) {
- tap_code(KC_RIGHT);
- } else {
- tap_code(KC_LEFT);
- }
-}
-
-void encoder_action_up_down(uint8_t clockwise) {
- if (clockwise) {
- tap_code(KC_UP);
- } else {
- tap_code(KC_DOWN);
- }
-}
-
-void encoder_action_paging(uint8_t clockwise) {
- if (clockwise) {
- tap_code(KC_PGUP);
- } else {
- tap_code(KC_PGDN);
- }
-}
-
-void encoder_action(encoder_mode_t mode, uint8_t clockwise) {
- switch (mode) {
- case ENC_MODE_VOLUME:
- encoder_action_volume(clockwise);
- break;
- case ENC_MODE_WORD_NAV:
- encoder_action_word_nav(clockwise);
- break;
- case ENC_MODE_LEFT_RIGHT:
- encoder_action_left_right(clockwise);
- break;
- case ENC_MODE_UP_DOWN:
- encoder_action_up_down(clockwise);
- break;
- case ENC_MODE_PAGING:
- encoder_action_paging(clockwise);
- break;
- default:
- encoder_action_volume(clockwise);
- }
-}