logo

qmk_firmware

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

keymap.c (1957B)


  1. /* Copyright 2019 Garret G. (TheRoyalSweatshirt)
  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. #define BASE 0
  18. #define FN 1
  19. #define XXX KC_NO
  20. #define KC_TR KC_TRANSPARENT
  21. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  22. /* BASE
  23. * ,----------------------------------------.
  24. * | DEL | UP | ENTER | | RGB |
  25. * |-------+-------+-------+-------+--------|
  26. * | LEFT | DOWN | RIGHT | | FN |
  27. * `----------------------------------------'
  28. */
  29. [BASE] = LAYOUT(
  30. KC_DEL, KC_UP, KC_ENT, UG_NEXT,
  31. KC_LEFT, KC_DOWN, KC_RIGHT, MO(1)
  32. ),
  33. /* FN
  34. * ,----------------------------------------.
  35. * | HU+ | Br+ | Sat+ | | |
  36. * |-------+-------+-------+-------+--------|
  37. * | HU- | Br- | Sat- | | |
  38. * `----------------------------------------'
  39. */
  40. [FN] = LAYOUT(
  41. UG_HUEU, UG_VALU, UG_SATU, KC_TR,
  42. UG_HUED, UG_VALD, UG_SATD, KC_TR
  43. )
  44. };
  45. /* Rotary Encoder Settings: */
  46. /* - Current Value = Horizontal Scrolling */
  47. bool encoder_update_user(uint8_t index, bool clockwise) {
  48. if (index == 0) {
  49. if (clockwise) {
  50. tap_code(KC_WH_L);
  51. } else {
  52. tap_code(KC_WH_R);
  53. }
  54. }
  55. return true;
  56. }