aboutsummaryrefslogtreecommitdiff
path: root/keyboards/dumbpad/v1x_dualencoder/templates/keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/dumbpad/v1x_dualencoder/templates/keymap.c')
-rw-r--r--keyboards/dumbpad/v1x_dualencoder/templates/keymap.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/keyboards/dumbpad/v1x_dualencoder/templates/keymap.c b/keyboards/dumbpad/v1x_dualencoder/templates/keymap.c
new file mode 100644
index 000000000..c602269ed
--- /dev/null
+++ b/keyboards/dumbpad/v1x_dualencoder/templates/keymap.c
@@ -0,0 +1,44 @@
1#include QMK_KEYBOARD_H
2const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {__KEYMAP_GOES_HERE__};
3
4
5bool encoder_update_user(uint8_t index, bool clockwise) {
6 if (index == 0) {
7 switch (get_highest_layer(layer_state)) {
8 case 0:
9 if (clockwise) {
10 tap_code(KC_MS_R);
11 } else {
12 tap_code(KC_MS_L);
13 }
14 break;
15
16 default:
17 if (clockwise) {
18 tap_code(KC_EQL);
19 } else {
20 tap_code(KC_MINS);
21 }
22 break;
23 }
24 } else if (index == 1) {
25 switch (get_highest_layer(layer_state)) {
26 case 0:
27 if (clockwise) {
28 tap_code(KC_VOLU);
29 } else {
30 tap_code(KC_VOLD);
31 }
32 break;
33
34 default:
35 if (clockwise) {
36 tap_code(KC_RIGHT);
37 } else {
38 tap_code(KC_LEFT);
39 }
40 break;
41 }
42 }
43 return true;
44}