keymap.c 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /* Copyright 2020 marksard
  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. enum layer_number {
  18. _BASE,
  19. _ADJUST,
  20. };
  21. enum custom_keycodes {
  22. LOWER = SAFE_RANGE,
  23. ADJUST,
  24. RGBRST
  25. };
  26. // Layer Mode aliases
  27. #define KC_LTAD LT(_ADJUST, KC_NO)
  28. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  29. [_BASE] = LAYOUT_ortho_4x10(
  30. //,---------------------------------------------------------------------------------------------------.
  31. XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
  32. //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------|
  33. XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
  34. //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------|
  35. XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
  36. //`---------+---------+---------+---------+---------+---------+---------+---------+---------+---------'
  37. KC_LTAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
  38. //,---------------------------------------------------------------------------------------------------.
  39. ),
  40. [_ADJUST] = LAYOUT_ortho_4x10(
  41. //,---------------------------------------------------------------------------------------------------.
  42. RESET, RGBRST, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
  43. //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------|
  44. RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
  45. //|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------|
  46. RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
  47. //`---------+---------+---------+---------+---------+---------+---------+---------+---------+---------'
  48. _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
  49. //,---------------------------------------------------------------------------------------------------.
  50. )
  51. };
  52. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  53. bool result = false;
  54. switch (keycode) {
  55. #ifdef RGBLIGHT_ENABLE
  56. case RGBRST:
  57. if (record->event.pressed) {
  58. eeconfig_update_rgblight_default();
  59. rgblight_enable();
  60. }
  61. break;
  62. #endif
  63. default:
  64. result = true;
  65. break;
  66. }
  67. return result;
  68. }