keymap.c 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #include "the_ruler.h"
  2. #include "action_layer.h"
  3. #include "eeconfig.h"
  4. extern keymap_config_t keymap_config;
  5. // Each layer gets a name for readability, which is then used in the keymap matrix below.
  6. // The underscores don't mean anything - you can have a layer called STUFF or any other name.
  7. // Layer names don't all need to be of the same length, obviously, and you can also skip them
  8. // entirely and just use numbers.
  9. #define _DEFAULT 0
  10. #define _FN_1 1
  11. #define _FN_2 2
  12. enum custom_keycodes {
  13. DEFAULT = SAFE_RANGE,
  14. FN_1,
  15. FN_2
  16. };
  17. // Fillers to make layering more clear
  18. #define _______ KC_TRNS
  19. #define XXXXXXX KC_NO
  20. // Defines for task manager and such
  21. #define CALTDEL LCTL(LALT(KC_DEL))
  22. #define TSKMGR LCTL(LSFT(KC_ESC))
  23. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  24. /* Default Layer
  25. * ,-----------------------------------------------.
  26. * | FN_2 | 2 |TSKMGR |CALTDEL| ESC | FN_1 |
  27. * `-----------------------------------------------'
  28. */
  29. [_DEFAULT] = KEYMAP( \
  30. MO(_FN_2), KC_2, TSKMGR, CALTDEL, KC_ESC, MO(_FN_1)
  31. ),
  32. /* FN 1 Layer
  33. * ,-----------------------------------------------.
  34. * |RGB_TOG|RGB_HUD|RGB_HUI|RGB_SAD|RGB_SAI| FN_1 |
  35. * `-----------------------------------------------'
  36. */
  37. [_FN_1] = KEYMAP( \
  38. RGB_TOG, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, _______
  39. ),
  40. /* FN 2 Layer
  41. * ,-----------------------------------------------.
  42. * | FN_2 |RGB_VAD|RGB_VAI|RGB_MOD|TSKMGR | RESET |
  43. * `-----------------------------------------------'
  44. */
  45. [_FN_2] = KEYMAP( \
  46. _______, RGB_VAD, RGB_VAI, RGB_MOD, TSKMGR, RESET
  47. )
  48. };
  49. void persistant_default_layer_set(uint16_t default_layer) {
  50. eeconfig_update_default_layer(default_layer);
  51. default_layer_set(default_layer);
  52. }
  53. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  54. switch (keycode) {
  55. // NONE
  56. }
  57. return true;
  58. }