lang_map.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #pragma once
  2. /*
  3. Copyright 2018-2022 Eric Gebhart <e.a.gebhart@gmail.com>
  4. This program is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation, either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. #define CONCATENATEKC(a, ...) a ## __VA_ARGS__
  16. #define CATKC(a, ...) CONCATENATEKC(a, __VA_ARGS__)
  17. #define LKC(NAME) CATKC(LANG_PFX, NAME)
  18. // NONE, DV = dvorak, BK=Beakl, BK2=Beakl27, BKW=Beaklwi.
  19. // Give the right keycode prefix by Alt target _IS
  20. #define ALT_TARGET_IS NONE
  21. #define TARGET_PFX CATKC(ALT_TARGET_IS, KC)
  22. #define NONEKC
  23. #define DVKC _DV
  24. #define BKKC _BK
  25. #define BKWKC _BKW
  26. #define BK2KC _BK2
  27. #define HDKC _HD
  28. #define HD_ELANKC _HD_E
  29. #define HD_DASHKC _HD_D
  30. #define CONCATENATETKC(a, ...) a ## __VA_ARGS__
  31. #define CATTKC(a, ...) CONCATENATETKC(a, __VA_ARGS__)
  32. // depending on the value of ALT_TARGET_IS and LANG_IS.
  33. // TL_COMM -> TLKC(_COMM)
  34. // TLKC(_COMM) -> _BK_COMM, _DV_COMM, _BK2_COMM, _BK_COMM, _HD_COMM...
  35. #define TLKC(NAME) CATTKC(TARGET_PFX, NAME)
  36. #define LANG_ROW(K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A) \
  37. LKC(K01), LKC(K02), LKC(K03), LKC(K04), LKC(K05), \
  38. LKC(K06), LKC(K07), LKC(K08), LKC(K09), LKC(K0A) \
  39. #define LANG_ROW12(K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C) \
  40. LKC(K01), LKC(K02), LKC(K03), LKC(K04), LKC(K05), LKC(K06), \
  41. LKC(K07), LKC(K08), LKC(K09), LKC(K0A), LKC(K0B), LKC(K0C) \
  42. // takes a 3x10
  43. #define LANG_MAP(K01, K02, K03, K04, K05, \
  44. K06, K07, K08, K09, K0A, \
  45. K11, K12, K13, K14, K15, \
  46. K16, K17, K18, K19, K1A, \
  47. K21, K22, K23, K24, K25, \
  48. K26, K27, K28, K29, K2A) \
  49. LKC(K01), LKC(K02), LKC(K03), LKC(K04), LKC(K05), \
  50. LKC(K06), LKC(K07), LKC(K08), LKC(K09), LKC(K0A), \
  51. LKC(K11), LKC(K12), LKC(K13), LKC(K14), LKC(K15), \
  52. LKC(K16), LKC(K17), LKC(K18), LKC(K19), LKC(K1A), \
  53. LKC(K21), LKC(K22), LKC(K23), LKC(K24), LKC(K25), \
  54. LKC(K26), LKC(K27), LKC(K28), LKC(K29), LKC(K2A)
  55. // takes a 3x12
  56. #define LANG_MAP6(K01, K02, K03, K04, K05, K06, \
  57. K07, K08, K09, K0A, K0B, K0C, \
  58. K11, K12, K13, K14, K15, K16, \
  59. K17, K18, K19, K1A, K1B, K1C, \
  60. K21, K22, K23, K24, K25, K26, \
  61. K27, K28, K29, K2A, K2B, K2C) \
  62. LKC(K01), LKC(K02), LKC(K03), LKC(K04), LKC(K05), LKC(K06), \
  63. LKC(K07), LKC(K08), LKC(K09), LKC(K0A), LKC(K0B), LKC(K0C), \
  64. LKC(K11), LKC(K12), LKC(K13), LKC(K14), LKC(K15), LKC(K16), \
  65. LKC(K18), LKC(K18), LKC(K19), LKC(K1A), LKC(K1B), LKC(K1C), \
  66. LKC(K21), LKC(K22), LKC(K23), LKC(K24), LKC(K25), LKC(K26), \
  67. LKC(K27), LKC(K28), LKC(K29), LKC(K2A), LKC(K2B), LKC(K2C)