logo

qmk_firmware

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

keymap.c (1627B)


  1. /* Copyright 2019 Josh Johnson
  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. [0] = LAYOUT( /* Base */
  19. KC_MUTE, KC_MPLY,
  20. KC_7, KC_8, KC_9, KC_PAST,
  21. KC_4, KC_5, KC_6, KC_PMNS,
  22. KC_1, KC_2, KC_3, KC_PPLS,
  23. MO(1), KC_0, KC_PDOT,KC_PENT
  24. ),
  25. [1] = LAYOUT( /* LED Control */
  26. _______, _______,
  27. _______, UG_NEXT, UG_PREV, UG_TOGG,
  28. UG_VALD, UG_VALU, UG_HUED, UG_HUEU,
  29. UG_SATD, UG_SATU, _______, _______,
  30. _______, _______, QK_BOOT, _______
  31. ),
  32. };
  33. bool encoder_update_user(uint8_t index, bool clockwise) {
  34. if (index == 0) { /* Left Encoder */
  35. if (clockwise) {
  36. tap_code(KC_VOLD);
  37. } else {
  38. tap_code(KC_VOLU);
  39. }
  40. } else if (index == 1) { /* Right Encoder */
  41. if (clockwise) {
  42. tap_code(KC_MPRV);
  43. } else {
  44. tap_code(KC_MNXT);
  45. }
  46. }
  47. return true;
  48. }