logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

keymap.c (664B)


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