summaryrefslogtreecommitdiff
path: root/keyboards/kyria/keymaps/gotham/encoder_utils.h
diff options
context:
space:
mode:
authorGautham Yerroju <gautham.yerroju@gmail.com>2020-06-13 01:24:13 -0700
committerGitHub <noreply@github.com>2020-06-13 01:24:13 -0700
commit4057d44989e2ee83ca3b171bdb1a29bc9f3ae0cd (patch)
treef74840f3af9af8ed245748fb430e363594a3d8c3 /keyboards/kyria/keymaps/gotham/encoder_utils.h
parent2bfcb6bfc5766ede2b63041af3a163408caa6ad9 (diff)
[Keymap] Add Kyria keymap (#9224)
* Add Kyria keymap * clean split hand detection code * rename "joystick" to "thumbstick" * thumbstick overhaul * removed angle correction, seems buggy * save some memory * Remove deprecated config option * Use the correct types for getting host led states * Fix include path * Made .h files for encoder and oled code * Increase speed cap on thumbstick
Diffstat (limited to 'keyboards/kyria/keymaps/gotham/encoder_utils.h')
-rw-r--r--keyboards/kyria/keymaps/gotham/encoder_utils.h37
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 0000000000..60db6c6bd8
--- /dev/null
+++ b/keyboards/kyria/keymaps/gotham/encoder_utils.h
@@ -0,0 +1,37 @@
+#pragma once
+
+#include <stdbool.h>
+
+#include "quantum.h"
+
+typedef enum {
+ ENC_MODE_VOLUME = 0,
+ ENC_MODE_WORD_NAV,
+ ENC_MODE_LEFT_RIGHT,
+ ENC_MODE_UP_DOWN,
+ ENC_MODE_PAGING,
+ _ENC_MODE_LAST // Do not use, except for looping through enum values
+} encoder_mode_t;
+
+encoder_mode_t encoder_left_mode;
+encoder_mode_t encoder_right_mode;
+
+void encoder_utils_init(void);
+
+void set_encoder_mode(bool left, encoder_mode_t mode);
+
+encoder_mode_t get_encoder_mode(bool left);
+
+void cycle_encoder_mode(bool left, bool reverse);
+
+void encoder_action_volume(uint8_t clockwise);
+
+void encoder_action_word_nav(uint8_t clockwise);
+
+void encoder_action_left_right(uint8_t clockwise);
+
+void encoder_action_up_down(uint8_t clockwise);
+
+void encoder_action_paging(uint8_t clockwise);
+
+void encoder_action(encoder_mode_t mode, uint8_t clockwise);