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_common.h 5.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. /*
  2. Copyright 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 <avr/pgmspace.h>
  19. #include "keycode.h"
  20. #include "action.h"
  21. #include "action_macro.h"
  22. #include "report.h"
  23. #include "host.h"
  24. #include "print.h"
  25. #include "debug.h"
  26. #include "keymap.h"
  27. #include "keymap_ex.h"
  28. /*
  29. #ifdef KEYMAP_EX_ENABLE
  30. extern const uint8_t keymaps[KEYMAPS_COUNT][MATRIX_ROWS][MATRIX_COLS];
  31. extern const uint16_t fn_actions[FN_ACTIONS_COUNT];
  32. #else
  33. */
  34. extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
  35. extern const uint16_t fn_actions[];
  36. //#endif
  37. /* GH60 keymap definition macro
  38. * K95 and K42 are extra keys for ISO
  39. * KB2 is extra key for HHKB
  40. */
  41. #define KEYMAP( \
  42. K27, K28, K38, K48, K58, K57, K67, K68, K78, K88, K98, K97, K77, KB7, KB2, \
  43. K22, K21, K31, K41, K51, K52, K62, K61, K71, K81, K91, K92, K72, KB3, \
  44. K32, K23, K33, K43, K53, K54, K64, K63, K73, K83, K93, K94, K95, KB5, \
  45. KA2, K42, K25, K35, K45, K55, K56, K66, K65, K75, K85, K96, KA5, KB6, \
  46. KA1, KB1, KA4, KB4, KA6, KA7, K86, KA3 \
  47. ) { \
  48. { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
  49. { KC_##K21, KC_##K22, KC_##K23, KC_NO, KC_##K25, KC_NO, KC_##K27, KC_##K28 }, \
  50. { KC_##K31, KC_##K32, KC_##K33, KC_NO, KC_##K35, KC_NO, KC_NO, KC_##K38 }, \
  51. { KC_##K41, KC_##K42, KC_##K43, KC_NO, KC_##K45, KC_NO, KC_NO, KC_##K48 }, \
  52. { KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57, KC_##K58 }, \
  53. { KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66, KC_##K67, KC_##K68 }, \
  54. { KC_##K71, KC_##K72, KC_##K73, KC_NO, KC_##K75, KC_NO, KC_##K77, KC_##K78 }, \
  55. { KC_##K81, KC_NO, KC_##K83, KC_NO, KC_##K85, KC_##K86, KC_NO, KC_##K88 }, \
  56. { KC_##K91, KC_##K92, KC_##K93, KC_##K94, KC_##K95, KC_##K96, KC_##K97, KC_##K98 }, \
  57. { KC_##KA1, KC_##KA2, KC_##KA3, KC_##KA4, KC_##KA5, KC_##KA6, KC_##KA7, KC_NO, }, \
  58. { KC_##KB1, KC_##KB2, KC_##KB3, KC_##KB4, KC_##KB5, KC_##KB6, KC_##KB7, KC_NO, }, \
  59. { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
  60. { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
  61. { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
  62. { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
  63. { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \
  64. }
  65. /* ANSI valiant. No extra keys for ISO */
  66. #define KEYMAP_ANSI( \
  67. K27, K28, K38, K48, K58, K57, K67, K68, K78, K88, K98, K97, K77, KB7, \
  68. K22, K21, K31, K41, K51, K52, K62, K61, K71, K81, K91, K92, K72, KB3, \
  69. K32, K23, K33, K43, K53, K54, K64, K63, K73, K83, K93, K94, KB5, \
  70. KA2, K25, K35, K45, K55, K56, K66, K65, K75, K85, K96, KA5, \
  71. KA1, KB1, KA4, KB4, KA6, KA7, K86, KA3 \
  72. ) KEYMAP( \
  73. K27, K28, K38, K48, K58, K57, K67, K68, K78, K88, K98, K97, K77, KB7, NO, \
  74. K22, K21, K31, K41, K51, K52, K62, K61, K71, K81, K91, K92, K72, KB3, \
  75. K32, K23, K33, K43, K53, K54, K64, K63, K73, K83, K93, K94, NO, KB5, \
  76. KA2, NO, K25, K35, K45, K55, K56, K66, K65, K75, K85, K96, KA5, NO, \
  77. KA1, KB1, KA4, KB4, KA6, KA7, K86, KA3 \
  78. )
  79. /* Winkeyless valiant. No context key */
  80. #define KEYMAP_WINKEYLESS( \
  81. K27, K28, K38, K48, K58, K57, K67, K68, K78, K88, K98, K97, K77, KB7, \
  82. K22, K21, K31, K41, K51, K52, K62, K61, K71, K81, K91, K92, K72, KB3, \
  83. K32, K23, K33, K43, K53, K54, K64, K63, K73, K83, K93, K94, KB5, \
  84. KA2, K25, K35, K45, K55, K56, K66, K65, K75, K85, K96, KA5, \
  85. KA1, KB1, KA4, KB4, KA7, K86, KA3 \
  86. ) KEYMAP_ANSI( \
  87. K27, K28, K38, K48, K58, K57, K67, K68, K78, K88, K98, K97, K77, KB7, \
  88. K22, K21, K31, K41, K51, K52, K62, K61, K71, K81, K91, K92, K72, KB3, \
  89. K32, K23, K33, K43, K53, K54, K64, K63, K73, K83, K93, K94, KB5, \
  90. KA2, K25, K35, K45, K55, K56, K66, K65, K75, K85, K96, KA5, \
  91. KA1, KB1, KA4, KB4, KA6, NO, K86, KA3 \
  92. )
  93. #define KEYMAP_HHKB( \
  94. K27, K28, K38, K48, K58, K57, K67, K68, K78, K88, K98, K97, K77, KB7, KB2, \
  95. K22, K21, K31, K41, K51, K52, K62, K61, K71, K81, K91, K92, K72, KB3, \
  96. K32, K23, K33, K43, K53, K54, K64, K63, K73, K83, K93, K94, KB5, \
  97. KA2, K25, K35, K45, K55, K56, K66, K65, K75, K85, K96, KA5, KB6, \
  98. KA1, KB1, KA4, KB4, KA6, KA7, K86, KA3 \
  99. ) KEYMAP( \
  100. K27, K28, K38, K48, K58, K57, K67, K68, K78, K88, K98, K97, K77, KB7, KB2, \
  101. K22, K21, K31, K41, K51, K52, K62, K61, K71, K81, K91, K92, K72, KB3, \
  102. K32, K23, K33, K43, K53, K54, K64, K63, K73, K83, K93, K94, NO, KB5, \
  103. KA2, NO, K25, K35, K45, K55, K56, K66, K65, K75, K85, K96, KA5, KB6, \
  104. KA1, KB1, KA4, KB4, KA6, KA7, K86, KA3 \
  105. )
  106. #endif