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 5.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /*
  2. Copyright 2016 Kai Ryu <[email protected]>
  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. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. */
  14. #include <avr/pgmspace.h>
  15. #include "keycode.h"
  16. #include "action.h"
  17. #include "keymap_common.h"
  18. // Default
  19. #ifdef KEYMAP_SECTION_ENABLE
  20. const uint8_t keymaps[KEYMAPS_COUNT][MATRIX_ROWS][MATRIX_COLS] __attribute__ ((section (".keymap.keymaps"))) = {
  21. #else
  22. const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
  23. #endif
  24. /* Keymap 0: Default Layer
  25. * ,-----------------------------. ,-----------------------------.
  26. * | `| 1| 2| 3| 4| 5| -| | =| 6| 7| 8| 9| 0| '|
  27. * |-----+---+---+---+---+-------| |---+---+---+---+---+---+-----|
  28. * |Tab | Q| W| E| R| T| | | | Y| U| I| O| P| \|
  29. * |-----+---+---+---+---|---| Fn| | Fn|---+---+---+---+---+-----|
  30. * |Caps | A| S| D| F| G|---| |---| H| J| K| L| ;|Retur|
  31. * |-----+---+---+---+---|---| | | |---+---+---+---+---+-----|
  32. * |Shift| Z| X| C| V| B| Fn| | Fn| N| M| ,| .| /|Shift|
  33. * `-----+---+---+---+---+-------' `-------+---+---+---+---+-----'
  34. * |Ctr|Gui|Alt|Lef|Rig| ,-------. ,-------. | Up|Dow| [| ]|Ctr|
  35. * `-------------------' |Esc|Ins| |Del|Alt| `-------------------'
  36. * ,---+---+---| |---+---+---.
  37. * | | |Hom| |PgU| | |
  38. * |Spc|BS |---| |---|Tab|Ent|
  39. * | | |End| |PgD| | |
  40. * `-----------' `-----------'
  41. */
  42. KEYMAP(
  43. GRV, 1, 2, 3, 4, 5, MINS, EQL, 6, 7, 8, 9, 0, QUOT, \
  44. TAB, Q, W, E, R, T, FN0, FN1, Y, U, I, O, P, BSLS, \
  45. CAPS,A, S, D, F, G, H, J, K, L, SCLN,ENT, \
  46. LSFT,Z, X, C, V, B, FN2, FN3, N, M, COMM,DOT, SLSH,RSFT, \
  47. LCTL,LGUI,LALT,LEFT,RGHT, UP, DOWN,LBRC,RBRC,RCTL, \
  48. ESC, INS, DEL, RALT, \
  49. HOME, PGUP, \
  50. SPC, BSPC,END, PGDN,TAB, ENT ),
  51. /* Keymap 1: Fn Layer
  52. * ,-----------------------------. ,-----------------------------.
  53. * | |F1 |F2 |F3 |F4 |F5 | | | |F6 |F7 |F8 |F9 |F10| |
  54. * |-----+---+---+---+---+-------| |---+---+---+---+---+---+-----|
  55. * | | | | | | | | | | | | | | | |
  56. * |-----+---+---+---+---|---| | | |---+---+---+---+---+-----|
  57. * | | | | | | |---| |---| | | | | | |
  58. * |-----+---+---+---+---|---| | | |---+---+---+---+---+-----|
  59. * | | | | | | | | | | | | | | | |
  60. * `-----+---+---+---+---+-------' `-------+---+---+---+---+-----'
  61. * | | | | | | ,-------. ,-------. | | | | | |
  62. * `-------------------' | | | | | | `-------------------'
  63. * ,---+---+---| |---+---+---.
  64. * | | | | | | | |
  65. * | | |---| |---| | |
  66. * | | | | | | | |
  67. * `-----------' `-----------'
  68. */
  69. KEYMAP(
  70. TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
  71. TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
  72. TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
  73. TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
  74. TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,TRNS, \
  75. TRNS,TRNS, TRNS,TRNS, \
  76. TRNS, TRNS, \
  77. TRNS,TRNS,TRNS, TRNS,TRNS,TRNS )
  78. };
  79. /*
  80. * Fn action definition
  81. */
  82. #ifdef KEYMAP_SECTION_ENABLE
  83. const uint16_t fn_actions[FN_ACTIONS_COUNT] __attribute__ ((section (".keymap.fn_actions"))) = {
  84. #else
  85. const uint16_t fn_actions[] PROGMEM = {
  86. #endif
  87. [0] = ACTION_LAYER_MOMENTARY(1),
  88. [1] = ACTION_LAYER_MOMENTARY(1),
  89. [2] = ACTION_LAYER_MOMENTARY(1),
  90. [3] = ACTION_LAYER_MOMENTARY(1)
  91. };
  92. #ifdef KEYMAP_IN_EEPROM_ENABLE
  93. uint16_t keys_count(void) {
  94. return sizeof(keymaps) / sizeof(keymaps[0]) * MATRIX_ROWS * MATRIX_COLS;
  95. }
  96. uint16_t fn_actions_count(void) {
  97. return sizeof(fn_actions) / sizeof(fn_actions[0]);
  98. }
  99. #endif