Keyboard firmwares for Atmel AVR and Cortex-M
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.

keymap_common.h 9.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. /*
  2. Copyright 2011,2012,2013 Jun Wako <[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. #ifndef KEYMAP_COMMON_H
  15. #define KEYMAP_COMMON_H
  16. #include <stdint.h>
  17. #include <stdbool.h>
  18. #include "keycode.h"
  19. #include "action.h"
  20. #include "action_macro.h"
  21. #include "report.h"
  22. #include "print.h"
  23. #include "debug.h"
  24. #include "keymap.h"
  25. /* All keys */
  26. #define KEYMAP_ALL( \
  27. K00, K02,K03,K04,K05,K06,K07,K08,K09,K0A,K0B,K0C,K0D, K0E,K0F,K0G, \
  28. K10,K11,K12,K13,K14,K15,K16,K17,K18,K19,K1A,K1B,K1C,K1D, K1E,K1F,K1G, K1H,K1I,K1J,K1K, \
  29. K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K2A,K2B,K2C,K2D, K2E,K2F,K2G, K2H,K2I,K2J, \
  30. K30,K31,K32,K33,K34,K35,K36,K37,K38,K39,K3A,K3B, K3D, K3H,K3I,K3J,K3K, \
  31. K40,K41,K42,K43,K44,K45,K46,K47,K48,K49,K4A, K4D, K4F, K4H,K4I,K4J, \
  32. K50,K51,K52, K55, K5A,K5B,K5C,K5D, K5E,K5F,K5G, K5H, K5J,K5K, \
  33. \
  34. K60, K61, K62, /* System Power, Sleep, Wake */ \
  35. K70, K71, K72, /* Mute, Volume Up, Volume Down */ \
  36. K80, K81, K82, K83, K84, /* Next, Previous, Stop, Pause, Media Select */ \
  37. K90, K91, K92, /* Mail, Calculator, My Computer */ \
  38. KA0, KA1, KA2, KA3, /* WWW Search, Home, Back, Forward */ \
  39. KB0, KB1, KB2 /* WWW Stop, Refresh, Favorites */ \
  40. ) { \
  41. { KC_NO, KC_##K00, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16 }, \
  42. { KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K20 }, \
  43. { KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28 }, \
  44. { KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K3D, KC_##K50, KC_##K31, KC_##K32 }, \
  45. { KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A }, \
  46. { KC_##K3B, KC_##K10, KC_##K40, KC_##K2D, KC_##K41, KC_##K42, KC_##K43, KC_##K44 }, \
  47. { KC_##K45, KC_##K46, KC_##K47, KC_##K48, KC_##K49, KC_##K4A, KC_##K4D, KC_##K1J }, \
  48. { KC_##K52, KC_##K55, KC_##K30, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06 }, \
  49. { KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K1H, KC_##K0F, KC_##K2H }, \
  50. { KC_##K2I, KC_##K2J, KC_##K1K, KC_##K3H, KC_##K3I, KC_##K3J, KC_##K3K, KC_##K4H }, \
  51. { KC_##K4I, KC_##K4J, KC_##K5H, KC_##K5J, KC_##K5K, KC_##K5D, KC_##K1I, KC_##K0C }, \
  52. { KC_##K0D, KC_##K5A, KC_##K80, KC_##K51, KC_##K5B, KC_##K5C, KC_##K60, KC_##K61 }, \
  53. { KC_##K70, KC_##K91, KC_##K83, KC_##K62, KC_##K82, KC_##KA0, KC_##KB2, KC_##KB1 }, \
  54. { KC_##KB0, KC_##KA3, KC_##KA2, KC_##K92, KC_##K90, KC_##K84, KC_##K81, KC_##K1F }, \
  55. { KC_##K4F, KC_##K1G, KC_##K72, KC_##K5E, KC_##K71, KC_##K5G, KC_##KA1, KC_##K2F }, \
  56. { KC_##K5F, KC_##K2G, KC_##K1E, KC_##K2E, KC_##K0E, KC_##K0G, KC_NO , KC_NO } \
  57. }
  58. /* US layout */
  59. #define KEYMAP( \
  60. K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, \
  61. K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \
  62. K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B,K5D, KF1,KE9,KFA, K6C,K75,K7D, \
  63. K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K5A, K6B,K73,K74,K79, \
  64. K12,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K59, KF5, K69,K72,K7A, \
  65. K14,K9F,K11, K29, K91,KA7,KAF,K94, KEB,KF2,KF4, K70, K71,KDA \
  66. ) \
  67. KEYMAP_ALL( \
  68. K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, \
  69. K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \
  70. K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B,K5D, KF1,KE9,KFA, K6C,K75,K7D, \
  71. K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K5A, K6B,K73,K74,K79, \
  72. K12,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K59, KF5, K69,K72,K7A, \
  73. K14,K9F,K11, K29, K91,KA7,KAF,K94, KEB,KF2,KF4, K70, K71,KDA, \
  74. \
  75. SYSTEM_POWER, SYSTEM_SLEEP, SYSTEM_WAKE, \
  76. AUDIO_MUTE, AUDIO_VOL_UP, AUDIO_VOL_DOWN, \
  77. MEDIA_NEXT_TRACK, MEDIA_PREV_TRACK, MEDIA_STOP, MEDIA_PLAY_PAUSE, MEDIA_SELECT, \
  78. MAIL, CALCULATOR, MY_COMPUTER, \
  79. WWW_SEARCH, WWW_HOME, WWW_BACK, WWW_FORWARD, \
  80. WWW_STOP, WWW_REFRESH, WWW_FAVORITES \
  81. )
  82. /* ISO layout */
  83. #define KEYMAP_ISO( \
  84. K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, \
  85. K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \
  86. K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B, KF1,KE9,KFA, K6C,K75,K7D, \
  87. K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52,K5D,K5A, K6B,K73,K74,K79, \
  88. K12,K61,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K59, KF5, K69,K72,K7A, \
  89. K14,K9F,K11, K29, K91,KA7,KAF,K94, KEB,KF2,KF4, K70, K71,KDA \
  90. ) \
  91. KEYMAP_ALL( \
  92. K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, \
  93. K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \
  94. K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B,K5D, KF1,KE9,KFA, K6C,K75,K7D, \
  95. K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K5A, K6B,K73,K74,K79, \
  96. K12,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K59, KF5, K69,K72,K7A, \
  97. K14,K9F,K11, K29, K91,KA7,KAF,K94, KEB,KF2,KF4, K70, K71,KDA, \
  98. \
  99. SYSTEM_POWER, SYSTEM_SLEEP, SYSTEM_WAKE, \
  100. AUDIO_MUTE, AUDIO_VOL_UP, AUDIO_VOL_DOWN, \
  101. MEDIA_NEXT_TRACK, MEDIA_PREV_TRACK, MEDIA_STOP, MEDIA_PLAY_PAUSE, MEDIA_SELECT, \
  102. MAIL, CALCULATOR, MY_COMPUTER, \
  103. WWW_SEARCH, WWW_HOME, WWW_BACK, WWW_FORWARD, \
  104. WWW_STOP, WWW_REFRESH, WWW_FAVORITES \
  105. )
  106. /* JIS layout */
  107. #define KEYMAP_JIS( \
  108. K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, \
  109. K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K6A,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \
  110. K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B, KF1,KE9,KFA, K6C,K75,K7D, \
  111. K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52,K5D, K5A, K6B,K73,K74,K79, \
  112. K12,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A,K51, K59, KF5, K69,K72,K7A, \
  113. K14,K9F,K11, K67,K29,K64,K13, K91,KA7,KAF,K94, KEB,KF2,KF4, K70, K71,KDA \
  114. ) \
  115. KEYMAP_ALL( \
  116. K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, \
  117. K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \
  118. K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B,K5D, KF1,KE9,KFA, K6C,K75,K7D, \
  119. K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K5A, K6B,K73,K74,K79, \
  120. K12,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K59, KF5, K69,K72,K7A, \
  121. K14,K9F,K11, K29, K91,KA7,KAF,K94, KEB,KF2,KF4, K70, K71,KDA, \
  122. \
  123. SYSTEM_POWER, SYSTEM_SLEEP, SYSTEM_WAKE, \
  124. AUDIO_MUTE, AUDIO_VOL_UP, AUDIO_VOL_DOWN, \
  125. MEDIA_NEXT_TRACK, MEDIA_PREV_TRACK, MEDIA_STOP, MEDIA_PLAY_PAUSE, MEDIA_SELECT, \
  126. MAIL, CALCULATOR, MY_COMPUTER, \
  127. WWW_SEARCH, WWW_HOME, WWW_BACK, WWW_FORWARD, \
  128. WWW_STOP, WWW_REFRESH, WWW_FAVORITES \
  129. )
  130. #endif