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.

156 lines
3.2 KiB

  1. /*
  2. Copyright 2011 Jun Wako <wakojun@gmail.com>
  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 COMMAND_H
  15. #define COMMAND
  16. /* TODO: Refactoring */
  17. typedef enum { ONESHOT, CONSOLE, MOUSEKEY } command_state_t;
  18. extern command_state_t command_state;
  19. /* This allows to extend commands. Return false when command is not processed. */
  20. bool command_extra(uint8_t code);
  21. bool command_console_extra(uint8_t code);
  22. #ifdef COMMAND_ENABLE
  23. uint8_t numkey2num(uint8_t code);
  24. bool command_proc(uint8_t code);
  25. #else
  26. #define command_proc(code) false
  27. #endif
  28. #ifndef MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
  29. #define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
  30. #endif
  31. #ifndef MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
  32. #define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
  33. #endif
  34. #ifndef MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
  35. #define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
  36. #endif
  37. #ifndef MAGIC_KEY_HELP1
  38. #define MAGIC_KEY_HELP1 H
  39. #endif
  40. #ifndef MAGIC_KEY_HELP2
  41. #define MAGIC_KEY_HELP2 SLASH
  42. #endif
  43. #ifndef MAGIC_KEY_DEBUG
  44. #define MAGIC_KEY_DEBUG D
  45. #endif
  46. #ifndef MAGIC_KEY_DEBUG_MATRIX
  47. #define MAGIC_KEY_DEBUG_MATRIX X
  48. #endif
  49. #ifndef MAGIC_KEY_DEBUG_KBD
  50. #define MAGIC_KEY_DEBUG_KBD K
  51. #endif
  52. #ifndef MAGIC_KEY_DEBUG_MOUSE
  53. #define MAGIC_KEY_DEBUG_MOUSE M
  54. #endif
  55. #ifndef MAGIC_KEY_VERSION
  56. #define MAGIC_KEY_VERSION V
  57. #endif
  58. #ifndef MAGIC_KEY_STATUS
  59. #define MAGIC_KEY_STATUS S
  60. #endif
  61. #ifndef MAGIC_KEY_CONSOLE
  62. #define MAGIC_KEY_CONSOLE C
  63. #endif
  64. #ifndef MAGIC_KEY_LAYER0_ALT1
  65. #define MAGIC_KEY_LAYER0_ALT1 ESC
  66. #endif
  67. #ifndef MAGIC_KEY_LAYER0_ALT2
  68. #define MAGIC_KEY_LAYER0_ALT2 GRAVE
  69. #endif
  70. #ifndef MAGIC_KEY_LAYER0
  71. #define MAGIC_KEY_LAYER0 0
  72. #endif
  73. #ifndef MAGIC_KEY_LAYER1
  74. #define MAGIC_KEY_LAYER1 1
  75. #endif
  76. #ifndef MAGIC_KEY_LAYER2
  77. #define MAGIC_KEY_LAYER2 2
  78. #endif
  79. #ifndef MAGIC_KEY_LAYER3
  80. #define MAGIC_KEY_LAYER3 3
  81. #endif
  82. #ifndef MAGIC_KEY_LAYER4
  83. #define MAGIC_KEY_LAYER4 4
  84. #endif
  85. #ifndef MAGIC_KEY_LAYER5
  86. #define MAGIC_KEY_LAYER5 5
  87. #endif
  88. #ifndef MAGIC_KEY_LAYER6
  89. #define MAGIC_KEY_LAYER6 6
  90. #endif
  91. #ifndef MAGIC_KEY_LAYER7
  92. #define MAGIC_KEY_LAYER7 7
  93. #endif
  94. #ifndef MAGIC_KEY_LAYER8
  95. #define MAGIC_KEY_LAYER8 8
  96. #endif
  97. #ifndef MAGIC_KEY_LAYER9
  98. #define MAGIC_KEY_LAYER9 9
  99. #endif
  100. #ifndef MAGIC_KEY_BOOTLOADER
  101. #define MAGIC_KEY_BOOTLOADER PAUSE
  102. #endif
  103. #ifndef MAGIC_KEY_LOCK
  104. #define MAGIC_KEY_LOCK CAPS
  105. #endif
  106. #ifndef MAGIC_KEY_EEPROM
  107. #define MAGIC_KEY_EEPROM E
  108. #endif
  109. #ifndef MAGIC_KEY_NKRO
  110. #define MAGIC_KEY_NKRO N
  111. #endif
  112. #ifndef MAGIC_KEY_SLEEP_LED
  113. #define MAGIC_KEY_SLEEP_LED Z
  114. #endif
  115. #define XMAGIC_KC(key) KC_##key
  116. #define MAGIC_KC(key) XMAGIC_KC(key)
  117. #endif