diff options
Diffstat (limited to 'keyboards/kyria/keymaps/gotham/encoder_utils.h')
| -rw-r--r-- | keyboards/kyria/keymaps/gotham/encoder_utils.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/keyboards/kyria/keymaps/gotham/encoder_utils.h b/keyboards/kyria/keymaps/gotham/encoder_utils.h new file mode 100644 index 000000000..60db6c6bd --- /dev/null +++ b/keyboards/kyria/keymaps/gotham/encoder_utils.h | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 3 | #include <stdbool.h> | ||
| 4 | |||
| 5 | #include "quantum.h" | ||
| 6 | |||
| 7 | typedef enum { | ||
| 8 | ENC_MODE_VOLUME = 0, | ||
| 9 | ENC_MODE_WORD_NAV, | ||
| 10 | ENC_MODE_LEFT_RIGHT, | ||
| 11 | ENC_MODE_UP_DOWN, | ||
| 12 | ENC_MODE_PAGING, | ||
| 13 | _ENC_MODE_LAST // Do not use, except for looping through enum values | ||
| 14 | } encoder_mode_t; | ||
| 15 | |||
| 16 | encoder_mode_t encoder_left_mode; | ||
| 17 | encoder_mode_t encoder_right_mode; | ||
| 18 | |||
| 19 | void encoder_utils_init(void); | ||
| 20 | |||
| 21 | void set_encoder_mode(bool left, encoder_mode_t mode); | ||
| 22 | |||
| 23 | encoder_mode_t get_encoder_mode(bool left); | ||
| 24 | |||
| 25 | void cycle_encoder_mode(bool left, bool reverse); | ||
| 26 | |||
| 27 | void encoder_action_volume(uint8_t clockwise); | ||
| 28 | |||
| 29 | void encoder_action_word_nav(uint8_t clockwise); | ||
| 30 | |||
| 31 | void encoder_action_left_right(uint8_t clockwise); | ||
| 32 | |||
| 33 | void encoder_action_up_down(uint8_t clockwise); | ||
| 34 | |||
| 35 | void encoder_action_paging(uint8_t clockwise); | ||
| 36 | |||
| 37 | void encoder_action(encoder_mode_t mode, uint8_t clockwise); | ||
