summaryrefslogtreecommitdiff
path: root/keyboards/takashicompany/dogtag/dogtag.c
diff options
context:
space:
mode:
authortakashicompany <t@kashi.company>2022-03-07 16:02:52 +0900
committerGitHub <noreply@github.com>2022-03-06 23:02:52 -0800
commit41fb9120d0aff73664da880871d4e168ad158ae2 (patch)
tree5cf2f2450c1ca127f35a547978c027a634524a49 /keyboards/takashicompany/dogtag/dogtag.c
parent6e61126e08a2219db81ab0fc2ad6b385e2bd6098 (diff)
[Keyboard] Update DogTag Macro Pad (#16446)
Co-authored-by: Drashna Jaelre <drashna@live.com>
Diffstat (limited to 'keyboards/takashicompany/dogtag/dogtag.c')
-rw-r--r--keyboards/takashicompany/dogtag/dogtag.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/keyboards/takashicompany/dogtag/dogtag.c b/keyboards/takashicompany/dogtag/dogtag.c
index 459ca9d3f8..e5d0779c08 100644
--- a/keyboards/takashicompany/dogtag/dogtag.c
+++ b/keyboards/takashicompany/dogtag/dogtag.c
@@ -17,11 +17,31 @@
#include "dogtag.h"
bool encoder_update_kb(uint8_t index, bool clockwise) {
- if (!encoder_update_user(index, clockwise)) { return false; }
- if (clockwise) {
- tap_code(KC_MS_WH_DOWN);
+ keypos_t key;
+ if (index == 0) {
+ if (clockwise) {
+ key.row = 2;
+ key.col = 1;
+ } else {
+ key.row = 2;
+ key.col = 0;
+ }
+ uint8_t layer = layer_switch_get_layer(key);
+ uint16_t keycode = keymap_key_to_keycode(layer, key);
+
+ tap_code16(keycode);
} else {
- tap_code(KC_MS_WH_UP);
+ if (clockwise) {
+ key.row = 5;
+ key.col = 0;
+ } else {
+ key.row = 5;
+ key.col = 1;
+ }
+ uint8_t layer = layer_switch_get_layer(key);
+ uint16_t keycode = keymap_key_to_keycode(layer, key);
+
+ tap_code16(keycode);
}
return true;