You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

keymap_default.c 3.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #include "keymap_common.h"
  2. #include "rgb.h"
  3. // Default
  4. #ifdef KEYMAP_SECTION_ENABLE
  5. const uint8_t keymaps[KEYMAPS_COUNT][MATRIX_SIZE] __attribute__ ((section (".keymap.keymaps"))) = {
  6. #else
  7. const uint8_t keymaps[][MATRIX_SIZE] PROGMEM = {
  8. #endif
  9. /* Keymap 0: Default Layer
  10. * ,---------------------------------------------------------------------------------------.
  11. * |Esc| | F1| F2| F3| F4| | F5| F6| F7| F8| | F9|F10|F11|F12|Psc|Slk|Pus| |
  12. * |---------------------------------------------------------------------------------------|
  13. * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |Ins|Hom|PgU|Num| /| *| -|
  14. * |---------------------------------------------------------------------------------------|
  15. * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \|Del|End|PgD| 7| 8| 9| |
  16. * |-----------------------------------------------------------------------------------| +|
  17. * |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return | | 4| 5| 6| |
  18. * |-----------------------------------------------------------| ,---. |---------------|
  19. * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | |Up | | 1| 2| 3| |
  20. * |-----------------------------------------------------------------------------------|Ent|
  21. * |Ctrl|Gui |Alt | Space |Alt |Gui |Fn0 |Ctrl|Lef|Dow|Rig| 0| .| |
  22. * `---------------------------------------------------------------------------------------'
  23. */
  24. KEYMAP_ANSI_104(
  25. ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,PAUS, \
  26. GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, \
  27. TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, DEL, END, PGDN, P7, P8, P9, PPLS, \
  28. CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, P4, P5, P6, \
  29. LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT, UP, P1, P2, P3, PENT, \
  30. LCTL,LGUI,LALT, SPC, RALT,RGUI,FN0, RCTL, LEFT,DOWN,RGHT, P0, PDOT ),
  31. };
  32. /*
  33. * Fn action definition
  34. */
  35. #ifdef KEYMAP_SECTION_ENABLE
  36. const uint16_t fn_actions[FN_ACTIONS_COUNT] __attribute__ ((section (".keymap.fn_actions"))) = {
  37. #else
  38. const uint16_t fn_actions[] PROGMEM = {
  39. #endif
  40. };
  41. #ifdef KEYMAP_IN_EEPROM_ENABLE
  42. uint16_t keys_count(void) {
  43. return sizeof(keymaps) / sizeof(keymaps[0]) * MATRIX_SIZE;
  44. }
  45. uint16_t fn_actions_count(void) {
  46. return sizeof(fn_actions) / sizeof(fn_actions[0]);
  47. }
  48. #endif
  49. #ifndef NO_ACTION_FUNCTION
  50. enum function_id {
  51. AF_RGB_TOGGLE = 0,
  52. AF_RGB_DECREASE,
  53. AF_RGB_INCREASE,
  54. AF_RGB_STEP
  55. };
  56. void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
  57. {
  58. #ifdef RGB_LED_ENABLE
  59. if (record->event.pressed) {
  60. switch (id) {
  61. case AF_RGB_TOGGLE:
  62. rgb_toggle();
  63. break;
  64. case AF_RGB_DECREASE:
  65. rgb_decrease();
  66. break;
  67. case AF_RGB_INCREASE:
  68. rgb_increase();
  69. break;
  70. case AF_RGB_STEP:
  71. rgb_step();
  72. break;
  73. }
  74. }
  75. #endif
  76. }
  77. #endif