keymap.c (664B)
1 // Copyright 2022 Markus Knutsson (@TweetyDaBird) 2 // SPDX-License-Identifier: GPL-2.0-or-later 3 4 #include QMK_KEYBOARD_H 5 6 // Defines names for use in layer keycodes and the keymap 7 enum layer_names { 8 _BASE, 9 _RGB 10 }; 11 12 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 13 /* Base */ 14 [_BASE] = LAYOUT( 15 KC_MPLY, 16 TO(_RGB), KC_MSEL, 17 KC_MPRV, KC_MNXT 18 ), 19 [_RGB] = LAYOUT( 20 KC_MPLY, 21 TO(_BASE), UG_VALU, 22 UG_TOGG, UG_VALD 23 ) 24 }; 25 26 bool encoder_update_user(uint8_t index, bool clockwise) { 27 if (index == 0) { 28 if (clockwise) { 29 tap_code(KC_VOLU); 30 } else { 31 tap_code(KC_VOLD); 32 } 33 } 34 return true; 35 };