aboutsummaryrefslogtreecommitdiff
path: root/keyboards/minimacro5/keymaps/media/keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/minimacro5/keymaps/media/keymap.c')
-rw-r--r--keyboards/minimacro5/keymaps/media/keymap.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/keyboards/minimacro5/keymaps/media/keymap.c b/keyboards/minimacro5/keymaps/media/keymap.c
new file mode 100644
index 000000000..f36954b07
--- /dev/null
+++ b/keyboards/minimacro5/keymaps/media/keymap.c
@@ -0,0 +1,43 @@
1#include QMK_KEYBOARD_H
2
3#define _MAIN 0
4
5void encoder_update_user(uint8_t index, bool clockwise) {
6 if (index == 0) { /* First encoder*/
7 if (clockwise) {
8 tap_code(KC_VOLU);
9 } else {
10 tap_code(KC_VOLD);
11 }
12 } else if (index == 1) { /* Second encoder*/
13 if (clockwise) {
14 tap_code(KC_3);
15 } else {
16 tap_code(KC_4);
17 }
18 } else if (index == 2) { /* Third encoder*/
19 if (clockwise) {
20 tap_code(KC_5);
21 } else {
22 tap_code(KC_6);
23 }
24 } else if (index == 3) { /* Fourth encoder*/
25 if (clockwise) {
26 tap_code(KC_7);
27 } else {
28 tap_code(KC_8);
29 }
30 } else if (index == 4) { /* Fifth encoder*/
31 if (clockwise) {
32 tap_code(KC_9);
33 } else {
34 tap_code(KC_0);
35 }
36 }
37}
38
39const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //buttion closest to usb is first
40 [_MAIN] = LAYOUT_ortho_1x5(
41 KC_MUTE, KC_MEDIA_PREV_TRACK, KC_MEDIA_NEXT_TRACK, KC_MEDIA_PLAY_PAUSE, KC_MEDIA_STOP
42 )
43};