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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /*
  2. Copyright 2015 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
  25. * ,-----------.
  26. * | |Up |Fn0|
  27. * |---+---+---|
  28. * |Lef|Dow|Rig|
  29. * `-----------'
  30. */
  31. KEYMAP( UP, FN0, LEFT,DOWN,RGHT ),
  32. /* Keymap 1
  33. * ,-----------.
  34. * | |PgU|Fn1|
  35. * |---+---+---|
  36. * |Hom|PgD|End|
  37. * `-----------'
  38. */
  39. KEYMAP( PGUP,FN1, HOME,PGDN,END ),
  40. /* Keymap 2
  41. * ,-----------.
  42. * | |Sel|Fn2|
  43. * |---+---+---|
  44. * |Pre|Pla|Nex|
  45. * `-----------'
  46. */
  47. KEYMAP( MSEL,FN2, MPRV,MPLY,MNXT ),
  48. /* Keymap 3
  49. * ,-----------.
  50. * | |MsU|Fn3|
  51. * |---+---+---|
  52. * |MsL|MsD|MsR|
  53. * `-----------'
  54. */
  55. KEYMAP( MS_U,FN3, MS_L,MS_D,MS_R ),
  56. /* Keymap 4
  57. * ,-----------.
  58. * | |Fn8|Fn4|
  59. * |---+---+---|
  60. * |Fn6|Fn5|Fn7|
  61. * `-----------'
  62. */
  63. KEYMAP( FN7, FN3, FN5, FN4, FN6 ),
  64. };
  65. /*
  66. * Fn action definition
  67. */
  68. #ifdef KEYMAP_SECTION_ENABLE
  69. const uint16_t fn_actions[FN_ACTIONS_COUNT] __attribute__ ((section (".keymap.fn_actions"))) = {
  70. #else
  71. const uint16_t fn_actions[] PROGMEM = {
  72. [0] = ACTION_DEFAULT_LAYER_SET(1),
  73. [1] = ACTION_DEFAULT_LAYER_SET(2),
  74. [2] = ACTION_DEFAULT_LAYER_SET(3),
  75. [3] = ACTION_DEFAULT_LAYER_SET(4),
  76. [4] = ACTION_DEFAULT_LAYER_SET(0),
  77. [5] = ACTION_BACKLIGHT_TOGGLE(),
  78. [6] = ACTION_BACKLIGHT_DECREASE(),
  79. [7] = ACTION_BACKLIGHT_INCREASE(),
  80. [8] = ACTION_BACKLIGHT_STEP()
  81. #endif
  82. };
  83. #ifdef KEYMAP_IN_EEPROM_ENABLE
  84. uint16_t keys_count(void) {
  85. return sizeof(keymaps) / sizeof(keymaps[0]) * MATRIX_ROWS * MATRIX_COLS;
  86. }
  87. uint16_t fn_actions_count(void) {
  88. return sizeof(fn_actions) / sizeof(fn_actions[0]);
  89. }
  90. #endif