summaryrefslogtreecommitdiff
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 0000000000..f36954b074
--- /dev/null
+++ b/keyboards/minimacro5/keymaps/media/keymap.c
@@ -0,0 +1,43 @@
+#include QMK_KEYBOARD_H
+
+#define _MAIN 0
+
+void encoder_update_user(uint8_t index, bool clockwise) {
+ if (index == 0) { /* First encoder*/
+ if (clockwise) {
+ tap_code(KC_VOLU);
+ } else {
+ tap_code(KC_VOLD);
+ }
+ } else if (index == 1) { /* Second encoder*/
+ if (clockwise) {
+ tap_code(KC_3);
+ } else {
+ tap_code(KC_4);
+ }
+ } else if (index == 2) { /* Third encoder*/
+ if (clockwise) {
+ tap_code(KC_5);
+ } else {
+ tap_code(KC_6);
+ }
+ } else if (index == 3) { /* Fourth encoder*/
+ if (clockwise) {
+ tap_code(KC_7);
+ } else {
+ tap_code(KC_8);
+ }
+ } else if (index == 4) { /* Fifth encoder*/
+ if (clockwise) {
+ tap_code(KC_9);
+ } else {
+ tap_code(KC_0);
+ }
+ }
+}
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //buttion closest to usb is first
+ [_MAIN] = LAYOUT_ortho_1x5(
+ KC_MUTE, KC_MEDIA_PREV_TRACK, KC_MEDIA_NEXT_TRACK, KC_MEDIA_PLAY_PAUSE, KC_MEDIA_STOP
+ )
+};