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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. Copyright 2014 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. #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_in_eeprom.h"
  28. extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
  29. extern const uint16_t fn_actions[];
  30. /* LR94 keymap definition macro
  31. * K1J, K3M and K2B are extra keys for ISO
  32. */
  33. #define KEYMAP( \
  34. K6A, K6B, K6C, K6D, K6E, K6F, K6G, K6H, K6I, K6J, K6K, K6L, K6M, K6N, K6P, K6Q, K0J, K5P, \
  35. K5A, K5B, K5C, K5D, K5E, K5F, K5G, K5H, K5I, K5J, K5K, K5L, K5M, K5N, K1J, K5Q, K0K, K4P, \
  36. K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, K4Q, K0L, K3P, \
  37. K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K3N, K3Q, K0M, K2P, \
  38. K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2N, K2M, K2Q, K0N, K1P, \
  39. K1A, K1B, K1C, K1F, K1K, K1L, K1M, K1N, K1Q, K0P, K0Q \
  40. ) { \
  41. { KC_NO, KC_##K1A, KC_##K2A, KC_##K3A, KC_##K4A, KC_##K5A, KC_##K6A }, \
  42. { KC_NO, KC_##K1B, KC_##K2B, KC_##K3B, KC_##K4B, KC_##K5B, KC_##K6B }, \
  43. { KC_NO, KC_##K1C, KC_##K2C, KC_##K3C, KC_##K4C, KC_##K5C, KC_##K6C }, \
  44. { KC_NO, KC_NO, KC_##K2D, KC_##K3D, KC_##K4D, KC_##K5D, KC_##K6D }, \
  45. { KC_NO, KC_NO, KC_##K2E, KC_##K3E, KC_##K4E, KC_##K5E, KC_##K6E }, \
  46. { KC_NO, KC_##K1F, KC_##K2F, KC_##K3F, KC_##K4F, KC_##K5F, KC_##K6F }, \
  47. { KC_NO, KC_NO, KC_##K2G, KC_##K3G, KC_##K4G, KC_##K5G, KC_##K6G }, \
  48. { KC_NO, KC_NO, KC_##K2H, KC_##K3H, KC_##K4H, KC_##K5H, KC_##K6H }, \
  49. { KC_NO, KC_NO, KC_##K2I, KC_##K3I, KC_##K4I, KC_##K5I, KC_##K6I }, \
  50. { KC_##K0J, KC_##K1J, KC_##K2J, KC_##K3J, KC_##K4J, KC_##K5J, KC_##K6J }, \
  51. { KC_##K0K, KC_##K1K, KC_##K2K, KC_##K3K, KC_##K4K, KC_##K5K, KC_##K6K }, \
  52. { KC_##K0L, KC_##K1L, KC_##K2L, KC_##K3L, KC_##K4L, KC_##K5L, KC_##K6L }, \
  53. { KC_##K0M, KC_##K1M, KC_##K2M, KC_##K3M, KC_##K4M, KC_##K5M, KC_##K6M }, \
  54. { KC_##K0N, KC_##K1N, KC_##K2N, KC_##K3N, KC_##K4N, KC_##K5N, KC_##K6N }, \
  55. { KC_##K0P, KC_##K1P, KC_##K2P, KC_##K3P, KC_##K4P, KC_##K5P, KC_##K6P }, \
  56. { KC_##K0Q, KC_##K1Q, KC_##K2Q, KC_##K3Q, KC_##K4Q, KC_##K5Q, KC_##K6Q } \
  57. }
  58. /* ANSI valiant. No extra keys for ISO */
  59. #define KEYMAP_ANSI( \
  60. K6A, K6C, K6D, K6E, K6F, K6G, K6H, K6I, K6J, K6K, K6L, K6M, K6N, K6P, K6Q, K0J, K5P, \
  61. K5A, K5B, K5C, K5D, K5E, K5F, K5G, K5H, K5I, K5J, K5K, K5L, K5M, K5N, K5Q, K0K, K4P, \
  62. K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, K4Q, K0L, K3P, \
  63. K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3N, \
  64. K2A, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2N, K0N, \
  65. K1A, K1B, K1C, K1F, K1K, K1L, K1M, K1N, K1Q, K0P, K0Q \
  66. ) KEYMAP( \
  67. K6A, NO, K6C, K6D, K6E, K6F, K6G, K6H, K6I, K6J, K6K, K6L, K6M, K6N, K6P, K6Q, K0J, K5P, \
  68. K5A, K5B, K5C, K5D, K5E, K5F, K5G, K5H, K5I, K5J, K5K, K5L, K5M, K5N, NO, K5Q, K0K, K4P, \
  69. K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, K4Q, K0L, K3P, \
  70. K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, NO, K3N, NO, NO, NO, \
  71. K2A, NO, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2N, NO, NO, K0N, NO, \
  72. K1A, K1B, K1C, K1F, K1K, K1L, K1M, K1N, K1Q, K0P, K0Q \
  73. )
  74. #endif