upload
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.

command.h 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. /*
  2. Copyright 2011 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 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. bool command_proc(uint8_t code);
  24. #else
  25. #define command_proc(code) false
  26. #endif
  27. #ifndef MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
  28. #define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
  29. #endif
  30. #ifndef MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
  31. #define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
  32. #endif
  33. #ifndef MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
  34. #define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
  35. #endif
  36. #ifndef MAGIC_KEY_HELP1
  37. #define MAGIC_KEY_HELP1 H
  38. #endif
  39. #ifndef MAGIC_KEY_HELP2
  40. #define MAGIC_KEY_HELP2 SLASH
  41. #endif
  42. #ifndef MAGIC_KEY_DEBUG
  43. #define MAGIC_KEY_DEBUG D
  44. #endif
  45. #ifndef MAGIC_KEY_DEBUG_MATRIX
  46. #define MAGIC_KEY_DEBUG_MATRIX X
  47. #endif
  48. #ifndef MAGIC_KEY_DEBUG_KBD
  49. #define MAGIC_KEY_DEBUG_KBD K
  50. #endif
  51. #ifndef MAGIC_KEY_DEBUG_MOUSE
  52. #define MAGIC_KEY_DEBUG_MOUSE M
  53. #endif
  54. #ifndef MAGIC_KEY_VERSION
  55. #define MAGIC_KEY_VERSION V
  56. #endif
  57. #ifndef MAGIC_KEY_STATUS
  58. #define MAGIC_KEY_STATUS S
  59. #endif
  60. #ifndef MAGIC_KEY_CONSOLE
  61. #define MAGIC_KEY_CONSOLE C
  62. #endif
  63. #ifndef MAGIC_KEY_LAYER0_ALT1
  64. #define MAGIC_KEY_LAYER0_ALT1 ESC
  65. #endif
  66. #ifndef MAGIC_KEY_LAYER0_ALT2
  67. #define MAGIC_KEY_LAYER0_ALT2 GRAVE
  68. #endif
  69. #ifndef MAGIC_KEY_LAYER0
  70. #define MAGIC_KEY_LAYER0 0
  71. #endif
  72. #ifndef MAGIC_KEY_LAYER1
  73. #define MAGIC_KEY_LAYER1 1
  74. #endif
  75. #ifndef MAGIC_KEY_LAYER2
  76. #define MAGIC_KEY_LAYER2 2
  77. #endif
  78. #ifndef MAGIC_KEY_LAYER3
  79. #define MAGIC_KEY_LAYER3 3
  80. #endif
  81. #ifndef MAGIC_KEY_LAYER4
  82. #define MAGIC_KEY_LAYER4 4
  83. #endif
  84. #ifndef MAGIC_KEY_LAYER5
  85. #define MAGIC_KEY_LAYER5 5
  86. #endif
  87. #ifndef MAGIC_KEY_LAYER6
  88. #define MAGIC_KEY_LAYER6 6
  89. #endif
  90. #ifndef MAGIC_KEY_LAYER7
  91. #define MAGIC_KEY_LAYER7 7
  92. #endif
  93. #ifndef MAGIC_KEY_LAYER8
  94. #define MAGIC_KEY_LAYER8 8
  95. #endif
  96. #ifndef MAGIC_KEY_LAYER9
  97. #define MAGIC_KEY_LAYER9 9
  98. #endif
  99. #ifndef MAGIC_KEY_BOOTLOADER
  100. #define MAGIC_KEY_BOOTLOADER PAUSE
  101. #endif
  102. #ifndef MAGIC_KEY_LOCK
  103. #define MAGIC_KEY_LOCK CAPS
  104. #endif
  105. #ifndef MAGIC_KEY_EEPROM
  106. #define MAGIC_KEY_EEPROM E
  107. #endif
  108. #ifndef MAGIC_KEY_NKRO
  109. #define MAGIC_KEY_NKRO N
  110. #endif
  111. #ifndef MAGIC_KEY_SLEEP_LED
  112. #define MAGIC_KEY_SLEEP_LED Z
  113. #endif
  114. #define XMAGIC_KC(key) KC_##key
  115. #define MAGIC_KC(key) XMAGIC_KC(key)
  116. #endif