logo

qmk_firmware

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

keymap.c (1618B)


  1. /* Copyright 2020 Keys of Kings
  2. *
  3. * This program is free software: you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License as published by
  5. * the Free Software Foundation, either version 2 of the License, or
  6. * (at your option) any later version.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #include QMK_KEYBOARD_H
  17. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  18. LAYOUT(
  19. LT(1, KC_MUTE),
  20. LT(4, KC_MPLY), LT(7, KC_MNXT)),
  21. LAYOUT(
  22. KC_TRNS,
  23. TO(2), TO(3)),
  24. LAYOUT(
  25. TO(0),
  26. UG_TOGG, UG_NEXT),
  27. LAYOUT(
  28. TO(0),
  29. UG_VALU, UG_VALD),
  30. LAYOUT(
  31. TO(0),
  32. UG_HUEU, UG_HUED),
  33. LAYOUT(
  34. TO(5),
  35. KC_TRNS, TO(6)),
  36. LAYOUT(
  37. TO(0),
  38. UG_SATU, UG_SATD),
  39. LAYOUT(
  40. TO(8),
  41. TO(9), KC_TRNS),
  42. LAYOUT(
  43. TO(0),
  44. CK_TOGG, MU_TOGG),
  45. LAYOUT(
  46. TO(0),
  47. QK_BOOT, EE_CLR),
  48. };
  49. void matrix_init_user(void) {
  50. debug_config.matrix = 1;
  51. debug_config.keyboard = 1;
  52. debug_config.enable = 1;
  53. }
  54. bool encoder_update_user(uint8_t index, bool clockwise) {
  55. if (index == 0) {
  56. if (clockwise) {
  57. tap_code(KC_VOLD);
  58. } else {
  59. tap_code(KC_VOLU);
  60. }
  61. # ifdef AUDIO_CLICKY
  62. clockwise ? clicky_freq_up() : clicky_freq_down();
  63. # endif
  64. }
  65. return true;
  66. }