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.

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