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.

725 lines
17 KiB

Velocikey: Match RGB animation speed to typing speed (#3754) * Draft commit of typing speed RGB control * More information in the readme * Support all RGB animation modes (Fixes #1) * Added support for all RGB light modes to use typing speed Except christmas lights because that is seizure-inducing at high speeds! * Introduced a value range specific to each RGB mode Because some modes are a little too much when running at full speed! * Update readme.md * Update readme.md * Re-arrange typing_speed definitions (Fixes #5) (#6) * Re-arrange variable definitions to avoid including quantum.h from rgblight.c * Fix a compilation error when trying to run make test:all * Tweaks to the typing speed decay rate * Renamed to momentum; moved implementation into dedicated files * Groundwork for toggling momentum on/off (currently always on) * Add EEPROM toggle for momentum-matching * Moved momentum out of RGBLIGHT_ENABLE toggles so it's more generic * Move momentum decay task out of rgblight_task() * Fix missing momentum.h in lufa.c * Experimental LED support (untested) * Draft commit of typing speed RGB control * More information in the readme * Support all RGB animation modes (Fixes #1) * Added support for all RGB light modes to use typing speed Except christmas lights because that is seizure-inducing at high speeds! * Introduced a value range specific to each RGB mode Because some modes are a little too much when running at full speed! * Update readme.md * Update readme.md * Re-arrange typing_speed definitions (Fixes #5) (#6) * Re-arrange variable definitions to avoid including quantum.h from rgblight.c * Fix a compilation error when trying to run make test:all * Tweaks to the typing speed decay rate * Renamed to momentum; moved implementation into dedicated files * Groundwork for toggling momentum on/off (currently always on) * Add EEPROM toggle for momentum-matching * Moved momentum out of RGBLIGHT_ENABLE toggles so it's more generic * Move momentum decay task out of rgblight_task() * Fix missing momentum.h in lufa.c * Added documentation * Renamed feature to velocikey * Reverted readme to original state * Correct the readme title * Updated feature name in the docs * Update EECONFIG name * Add compile-time toggles for velocikey * Update feature documentation * Revert "Merge branch 'led-support' into master" This reverts commit e123ff5febf61639b9a9020748e1c2e2313460ff, reversing changes made to df111a55b9d4929182e16108b1c0ead15b16df97. * Move velocikey EECONFIG definition to depend on VELOCIKEY_ENABLE * Rename decay_task function to decelerate * Apply suggestions from code review Co-Authored-By: chrislewisdev <chris@chrislewisdev.com> * Re-order eeconfig definitions * Apply coding conventions * Apply #ifdef check in lufa.c * Refactored interval time checks into one functionc * Small rename * Fix unused function error for layouts not using all rgb effects * Only update EEPROM if Velocikey is enabled * Incorporate code review feedback * Small adjustment to top-end decay rate * Add Velocikey documentation to table of contents * Bring tetris:default keymap size down by disabling audio
5 years ago
Overhaul Unicode Common functionality (#4325) * Standardize the Unicode EEPROM code * Remove unicode init from process_record_* functions * Add unicode init to where it belongs: matrix_init_quantum * Move Unicode proccessing to unicode common * Add audio feedback to input mode keys to drive konstantin up a wall * Tap_code cleanup * Update keycodes * Update unicode documentation * Update unicode keycodes for consistency/easier merge * Add Audio Feedback section * Remove Functions from feature page And link to the file instead. Link to specific lines later on. * Fix spacing Co-Authored-By: drashna <drashna@live.com> * Because I missed it! Co-Authored-By: drashna <drashna@live.com> * Fix spacing Co-Authored-By: drashna <drashna@live.com> * SPAAAAAAAAAACing Co-Authored-By: drashna <drashna@live.com> * Add BSD for future compatibility * Thought I fixed that! Co-Authored-By: drashna <drashna@live.com> * non-breaking Co-Authored-By: drashna <drashna@live.com> * Considered that Co-Authored-By: drashna <drashna@live.com> * Yuuup Co-Authored-By: drashna <drashna@live.com> * consistency Co-Authored-By: drashna <drashna@live.com> * white spaces .... copied from elsewhere Co-Authored-By: drashna <drashna@live.com> * white spaces Co-Authored-By: drashna <drashna@live.com> * white spaces Co-Authored-By: drashna <drashna@live.com> * Update keycode defines * Fix Linux Song * Update all of the songs * Cleanup * Move and update check to ensure only one unicode method is enabled * Update quantum/quantum_keycodes.h * Update documentation * Wordsmithing and cleanup * Format unicode_common (#13) * case alignment * process_record_unicode_common → process_unicode_common * Move song arrays into function where they're used, align preprocessor directives * Swap the order of UC_WIN and UC_BSD * Update Unicode docs * Reorder Unicode mode stuff to match the order of input mode constants * Fix capitalization in doc subtitle * Readd BSD and OSX_RALT songs * Reword BSD note in docs * Readd BSD keycode description * Reword explanation of input on different platforms * Steal vomindoraan's input mode documentation Co-Authored-By: vomindoraan (vomindoraan@gmail.com) * Willingly give Drashna the rest of my Unicode doc improvements * Wordsmithing Co-Authored-By: drashna <drashna@live.com> * remove merge artifacts * Unicode common cleanup (#17) * Standardize the Unicode EEPROM code * Remove unicode init from process_record_* functions * Add unicode init to where it belongs: matrix_init_quantum * Move Unicode proccessing to unicode common * Add audio feedback to input mode keys to drive konstantin up a wall * Tap_code cleanup * Update keycodes * Update unicode documentation * Update unicode keycodes for consistency/easier merge * Add Audio Feedback section * Remove Functions from feature page And link to the file instead. Link to specific lines later on. * Fix white spaces Co-Authored-By: drashna <drashna@live.com> * Fix spacing Co-Authored-By: drashna <drashna@live.com> * Because I missed it! Co-Authored-By: drashna <drashna@live.com> * Fix spacing Co-Authored-By: drashna <drashna@live.com> * SPAAAAAAAAAACing Co-Authored-By: drashna <drashna@live.com> * white spaces Co-Authored-By: drashna <drashna@live.com> * Add BSD for future compatibility * Thought I fixed that! Co-Authored-By: drashna <drashna@live.com> * non-breaking Co-Authored-By: drashna <drashna@live.com> * Considered that Co-Authored-By: drashna <drashna@live.com> * Yuuup Co-Authored-By: drashna <drashna@live.com> * consistency Co-Authored-By: drashna <drashna@live.com> * white spaces .... copied from elsewhere Co-Authored-By: drashna <drashna@live.com> * white spaces Co-Authored-By: drashna <drashna@live.com> * white spaces Co-Authored-By: drashna <drashna@live.com> * Update keycode defines * Fix Linux Song * Update all of the songs * Cleanup * Move and update check to ensure only one unicode method is enabled * Update quantum/quantum_keycodes.h * Update documentation * Wordsmithing and cleanup * Format unicode_common (#13) * case alignment * process_record_unicode_common → process_unicode_common * Move song arrays into function where they're used, align preprocessor directives * Swap the order of UC_WIN and UC_BSD * Update Unicode docs * Reorder Unicode mode stuff to match the order of input mode constants * Fix capitalization in doc subtitle * Readd BSD and OSX_RALT songs * Reword BSD note in docs * Readd BSD keycode description * Reword explanation of input on different platforms * Steal vomindoraan's input mode documentation Co-Authored-By: vomindoraan (vomindoraan@gmail.com) * Willingly give Drashna the rest of my Unicode doc improvements * Wordsmithing Co-Authored-By: drashna <drashna@live.com> * Rearrange process_unicode_common functions * Make Unicode input mode constants (UC_*) an enum * Simplify unicode_input_start/finish code * Make the key used for WinCompose configurable * Remove UC_OSX_RALT in favor of setting the key with UNICODE_OSX_KEY * Update Unicode input mode doc * Add descriptions and rearrange definitions in process_unicode_common.h * Add registry command to Unicode docs + misc updates * Reword an explanation in Unicode docs * Add TODO comment * Remove trailing whitespace * Improve Cycling documentation * Add Unicode Input method Cycling support (#19) * Standardize the Unicode EEPROM code * Remove unicode init from process_record_* functions * Add unicode init to where it belongs: matrix_init_quantum * Move Unicode proccessing to unicode common * Add audio feedback to input mode keys to drive konstantin up a wall * Tap_code cleanup * Update keycodes * Update unicode documentation * Update unicode keycodes for consistency/easier merge * Add Audio Feedback section * Remove Functions from feature page And link to the file instead. Link to specific lines later on. * Fix white spaces Co-Authored-By: drashna <drashna@live.com> * Fix spacing Co-Authored-By: drashna <drashna@live.com> * Because I missed it! Co-Authored-By: drashna <drashna@live.com> * Fix spacing Co-Authored-By: drashna <drashna@live.com> * SPAAAAAAAAAACing Co-Authored-By: drashna <drashna@live.com> * white spaces Co-Authored-By: drashna <drashna@live.com> * Add BSD for future compatibility * Thought I fixed that! Co-Authored-By: drashna <drashna@live.com> * non-breaking Co-Authored-By: drashna <drashna@live.com> * Considered that Co-Authored-By: drashna <drashna@live.com> * Yuuup Co-Authored-By: drashna <drashna@live.com> * consistency Co-Authored-By: drashna <drashna@live.com> * white spaces .... copied from elsewhere Co-Authored-By: drashna <drashna@live.com> * white spaces Co-Authored-By: drashna <drashna@live.com> * white spaces Co-Authored-By: drashna <drashna@live.com> * Update keycode defines * Fix Linux Song * Update all of the songs * Cleanup * Move and update check to ensure only one unicode method is enabled * Update quantum/quantum_keycodes.h * Update documentation * Wordsmithing and cleanup * Format unicode_common (#13) * case alignment * process_record_unicode_common → process_unicode_common * Move song arrays into function where they're used, align preprocessor directives * Swap the order of UC_WIN and UC_BSD * Update Unicode docs * Reorder Unicode mode stuff to match the order of input mode constants * Fix capitalization in doc subtitle * Readd BSD and OSX_RALT songs * Reword BSD note in docs * Readd BSD keycode description * Reword explanation of input on different platforms * Steal vomindoraan's input mode documentation Co-Authored-By: vomindoraan (vomindoraan@gmail.com) * Willingly give Drashna the rest of my Unicode doc improvements * Wordsmithing Co-Authored-By: drashna <drashna@live.com> * Rearrange process_unicode_common functions * Make Unicode input mode constants (UC_*) an enum * Simplify unicode_input_start/finish code * Make the key used for WinCompose configurable * Remove UC_OSX_RALT in favor of setting the key with UNICODE_OSX_KEY * Update Unicode input mode doc * Add descriptions and rearrange definitions in process_unicode_common.h * Add registry command to Unicode docs + misc updates * Reword an explanation in Unicode docs * Add TODO comment * Add cycle_unicode_input_mode and UNICODE_SELECTED_MODES macro * Add an option for making cycle changes persistent * Add debug prints to functions that change input_mode * Use cycle_unicode_input_mode in whitefox/konstantin * Add persist_unicode_input_mode function * Add offset to cycle to allow stepping in reverse * Add keycodes: UNICODE_MODE_FORWARD, UNICODE_MODE_REVERSE Aliases: UC_MOD, UC_RMOD (respectively) * REVERT ME: Undo changes to whitefox/konstantin to avoid conflicts * Fix wrong constant name * Revert "REVERT ME: Undo changes to whitefox/konstantin to avoid conflicts" This reverts commit 42676bf251fc8e3823f5e614dad6e510ba47a2f3. * Change dprintf text * Give selected modes priority over EEPROM when !UNICODE_CYCLE_PERSIST * Remove trailing whitespace * Cleanup of RALT code and unicode compilation stuff * Remove else for unicode handling
5 years ago
  1. /* Copyright 2016-2017 Jack Humbert
  2. *
  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. *
  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. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #ifndef QUANTUM_KEYCODES_H
  17. #define QUANTUM_KEYCODES_H
  18. #ifndef MIDI_ENABLE_STRICT
  19. #define MIDI_ENABLE_STRICT 0
  20. #endif
  21. #if !MIDI_ENABLE_STRICT || (defined(MIDI_ENABLE) && defined(MIDI_ADVANCED))
  22. #ifndef MIDI_TONE_KEYCODE_OCTAVES
  23. #define MIDI_TONE_KEYCODE_OCTAVES 3
  24. #endif
  25. #endif
  26. // Fillers to make layering more clear
  27. #define _______ KC_TRNS
  28. #define XXXXXXX KC_NO
  29. enum quantum_keycodes {
  30. // Ranges used in shortucuts - not to be used directly
  31. QK_TMK = 0x0000,
  32. QK_TMK_MAX = 0x00FF,
  33. QK_MODS = 0x0100,
  34. QK_LCTL = 0x0100,
  35. QK_LSFT = 0x0200,
  36. QK_LALT = 0x0400,
  37. QK_LGUI = 0x0800,
  38. QK_RMODS_MIN = 0x1000,
  39. QK_RCTL = 0x1100,
  40. QK_RSFT = 0x1200,
  41. QK_RALT = 0x1400,
  42. QK_RGUI = 0x1800,
  43. QK_MODS_MAX = 0x1FFF,
  44. QK_FUNCTION = 0x2000,
  45. QK_FUNCTION_MAX = 0x2FFF,
  46. QK_MACRO = 0x3000,
  47. QK_MACRO_MAX = 0x3FFF,
  48. QK_LAYER_TAP = 0x4000,
  49. QK_LAYER_TAP_MAX = 0x4FFF,
  50. QK_TO = 0x5000,
  51. QK_TO_MAX = 0x50FF,
  52. QK_MOMENTARY = 0x5100,
  53. QK_MOMENTARY_MAX = 0x51FF,
  54. QK_DEF_LAYER = 0x5200,
  55. QK_DEF_LAYER_MAX = 0x52FF,
  56. QK_TOGGLE_LAYER = 0x5300,
  57. QK_TOGGLE_LAYER_MAX = 0x53FF,
  58. QK_ONE_SHOT_LAYER = 0x5400,
  59. QK_ONE_SHOT_LAYER_MAX = 0x54FF,
  60. QK_ONE_SHOT_MOD = 0x5500,
  61. QK_ONE_SHOT_MOD_MAX = 0x55FF,
  62. QK_TAP_DANCE = 0x5700,
  63. QK_TAP_DANCE_MAX = 0x57FF,
  64. QK_LAYER_TAP_TOGGLE = 0x5800,
  65. QK_LAYER_TAP_TOGGLE_MAX = 0x58FF,
  66. QK_LAYER_MOD = 0x5900,
  67. QK_LAYER_MOD_MAX = 0x59FF,
  68. #ifdef STENO_ENABLE
  69. QK_STENO = 0x5A00,
  70. QK_STENO_BOLT = 0x5A30,
  71. QK_STENO_GEMINI = 0x5A31,
  72. QK_STENO_MAX = 0x5A3F,
  73. #endif
  74. #ifdef SWAP_HANDS_ENABLE
  75. QK_SWAP_HANDS = 0x5B00,
  76. QK_SWAP_HANDS_MAX = 0x5BFF,
  77. #endif
  78. QK_MOD_TAP = 0x6000,
  79. QK_MOD_TAP_MAX = 0x7FFF,
  80. #ifdef UNICODE_ENABLE
  81. QK_UNICODE = 0x8000,
  82. QK_UNICODE_MAX = 0xFFFF,
  83. #endif
  84. #ifdef UNICODEMAP_ENABLE
  85. QK_UNICODEMAP = 0x8000,
  86. QK_UNICODEMAP_MAX = 0x83FF,
  87. #endif
  88. // Loose keycodes - to be used directly
  89. RESET = 0x5C00,
  90. DEBUG,
  91. MAGIC_SWAP_CONTROL_CAPSLOCK,
  92. MAGIC_CAPSLOCK_TO_CONTROL,
  93. MAGIC_SWAP_LALT_LGUI,
  94. MAGIC_SWAP_RALT_RGUI,
  95. MAGIC_NO_GUI,
  96. MAGIC_SWAP_GRAVE_ESC,
  97. MAGIC_SWAP_BACKSLASH_BACKSPACE,
  98. MAGIC_HOST_NKRO,
  99. MAGIC_SWAP_ALT_GUI,
  100. MAGIC_UNSWAP_CONTROL_CAPSLOCK,
  101. MAGIC_UNCAPSLOCK_TO_CONTROL,
  102. MAGIC_UNSWAP_LALT_LGUI,
  103. MAGIC_UNSWAP_RALT_RGUI,
  104. MAGIC_UNNO_GUI,
  105. MAGIC_UNSWAP_GRAVE_ESC,
  106. MAGIC_UNSWAP_BACKSLASH_BACKSPACE,
  107. MAGIC_UNHOST_NKRO,
  108. MAGIC_UNSWAP_ALT_GUI,
  109. MAGIC_TOGGLE_NKRO,
  110. MAGIC_TOGGLE_ALT_GUI,
  111. GRAVE_ESC,
  112. // Leader key
  113. #ifdef LEADER_ENABLE
  114. KC_LEAD,
  115. #endif
  116. // Auto Shift setup
  117. KC_ASUP,
  118. KC_ASDN,
  119. KC_ASRP,
  120. KC_ASTG,
  121. KC_ASON,
  122. KC_ASOFF,
  123. // Audio on/off/toggle
  124. AU_ON,
  125. AU_OFF,
  126. AU_TOG,
  127. // Faux clicky as part of main audio feature
  128. CLICKY_TOGGLE,
  129. CLICKY_ENABLE,
  130. CLICKY_DISABLE,
  131. CLICKY_UP,
  132. CLICKY_DOWN,
  133. CLICKY_RESET,
  134. #ifdef FAUXCLICKY_ENABLE
  135. // Faux clicky
  136. FC_ON,
  137. FC_OFF,
  138. FC_TOG,
  139. #endif
  140. // Music mode on/off/toggle
  141. MU_ON,
  142. MU_OFF,
  143. MU_TOG,
  144. // Music mode cycle
  145. MU_MOD,
  146. // Music voice iterate
  147. MUV_IN,
  148. MUV_DE,
  149. // Midi
  150. #if !MIDI_ENABLE_STRICT || (defined(MIDI_ENABLE) && defined(MIDI_BASIC))
  151. MI_ON,
  152. MI_OFF,
  153. MI_TOG,
  154. #endif
  155. #if !MIDI_ENABLE_STRICT || (defined(MIDI_ENABLE) && defined(MIDI_ADVANCED))
  156. MIDI_TONE_MIN,
  157. #if !MIDI_ENABLE_STRICT || MIDI_TONE_KEYCODE_OCTAVES > 0
  158. MI_C = MIDI_TONE_MIN,
  159. MI_Cs,
  160. MI_Db = MI_Cs,
  161. MI_D,
  162. MI_Ds,
  163. MI_Eb = MI_Ds,
  164. MI_E,
  165. MI_F,
  166. MI_Fs,
  167. MI_Gb = MI_Fs,
  168. MI_G,
  169. MI_Gs,
  170. MI_Ab = MI_Gs,
  171. MI_A,
  172. MI_As,
  173. MI_Bb = MI_As,
  174. MI_B,
  175. #endif
  176. #if !MIDI_ENABLE_STRICT || MIDI_TONE_KEYCODE_OCTAVES > 1
  177. MI_C_1,
  178. MI_Cs_1,
  179. MI_Db_1 = MI_Cs_1,
  180. MI_D_1,
  181. MI_Ds_1,
  182. MI_Eb_1 = MI_Ds_1,
  183. MI_E_1,
  184. MI_F_1,
  185. MI_Fs_1,
  186. MI_Gb_1 = MI_Fs_1,
  187. MI_G_1,
  188. MI_Gs_1,
  189. MI_Ab_1 = MI_Gs_1,
  190. MI_A_1,
  191. MI_As_1,
  192. MI_Bb_1 = MI_As_1,
  193. MI_B_1,
  194. #endif
  195. #if !MIDI_ENABLE_STRICT || MIDI_TONE_KEYCODE_OCTAVES > 2
  196. MI_C_2,
  197. MI_Cs_2,
  198. MI_Db_2 = MI_Cs_2,
  199. MI_D_2,
  200. MI_Ds_2,
  201. MI_Eb_2 = MI_Ds_2,
  202. MI_E_2,
  203. MI_F_2,
  204. MI_Fs_2,
  205. MI_Gb_2 = MI_Fs_2,
  206. MI_G_2,
  207. MI_Gs_2,
  208. MI_Ab_2 = MI_Gs_2,
  209. MI_A_2,
  210. MI_As_2,
  211. MI_Bb_2 = MI_As_2,
  212. MI_B_2,
  213. #endif
  214. #if !MIDI_ENABLE_STRICT || MIDI_TONE_KEYCODE_OCTAVES > 3
  215. MI_C_3,
  216. MI_Cs_3,
  217. MI_Db_3 = MI_Cs_3,
  218. MI_D_3,
  219. MI_Ds_3,
  220. MI_Eb_3 = MI_Ds_3,
  221. MI_E_3,
  222. MI_F_3,
  223. MI_Fs_3,
  224. MI_Gb_3 = MI_Fs_3,
  225. MI_G_3,
  226. MI_Gs_3,
  227. MI_Ab_3 = MI_Gs_3,
  228. MI_A_3,
  229. MI_As_3,
  230. MI_Bb_3 = MI_As_3,
  231. MI_B_3,
  232. #endif
  233. #if !MIDI_ENABLE_STRICT || MIDI_TONE_KEYCODE_OCTAVES > 4
  234. MI_C_4,
  235. MI_Cs_4,
  236. MI_Db_4 = MI_Cs_4,
  237. MI_D_4,
  238. MI_Ds_4,
  239. MI_Eb_4 = MI_Ds_4,
  240. MI_E_4,
  241. MI_F_4,
  242. MI_Fs_4,
  243. MI_Gb_4 = MI_Fs_4,
  244. MI_G_4,
  245. MI_Gs_4,
  246. MI_Ab_4 = MI_Gs_4,
  247. MI_A_4,
  248. MI_As_4,
  249. MI_Bb_4 = MI_As_4,
  250. MI_B_4,
  251. #endif
  252. #if !MIDI_ENABLE_STRICT || MIDI_TONE_KEYCODE_OCTAVES > 5
  253. MI_C_5,
  254. MI_Cs_5,
  255. MI_Db_5 = MI_Cs_5,
  256. MI_D_5,
  257. MI_Ds_5,
  258. MI_Eb_5 = MI_Ds_5,
  259. MI_E_5,
  260. MI_F_5,
  261. MI_Fs_5,
  262. MI_Gb_5 = MI_Fs_5,
  263. MI_G_5,
  264. MI_Gs_5,
  265. MI_Ab_5 = MI_Gs_5,
  266. MI_A_5,
  267. MI_As_5,
  268. MI_Bb_5 = MI_As_5,
  269. MI_B_5,
  270. #endif
  271. #if !MIDI_ENABLE_STRICT || MIDI_TONE_KEYCODE_OCTAVES > 5
  272. MIDI_TONE_MAX = MI_B_5,
  273. #elif MIDI_TONE_KEYCODE_OCTAVES > 4
  274. MIDI_TONE_MAX = MI_B_4,
  275. #elif MIDI_TONE_KEYCODE_OCTAVES > 3
  276. MIDI_TONE_MAX = MI_B_3,
  277. #elif MIDI_TONE_KEYCODE_OCTAVES > 2
  278. MIDI_TONE_MAX = MI_B_2,
  279. #elif MIDI_TONE_KEYCODE_OCTAVES > 1
  280. MIDI_TONE_MAX = MI_B_1,
  281. #elif MIDI_TONE_KEYCODE_OCTAVES > 0
  282. MIDI_TONE_MAX = MI_B,
  283. #endif
  284. MIDI_OCTAVE_MIN,
  285. MI_OCT_N2 = MIDI_OCTAVE_MIN,
  286. MI_OCT_N1,
  287. MI_OCT_0,
  288. MI_OCT_1,
  289. MI_OCT_2,
  290. MI_OCT_3,
  291. MI_OCT_4,
  292. MI_OCT_5,
  293. MI_OCT_6,
  294. MI_OCT_7,
  295. MIDI_OCTAVE_MAX = MI_OCT_7,
  296. MI_OCTD, // octave down
  297. MI_OCTU, // octave up
  298. MIDI_TRANSPOSE_MIN,
  299. MI_TRNS_N6 = MIDI_TRANSPOSE_MIN,
  300. MI_TRNS_N5,
  301. MI_TRNS_N4,
  302. MI_TRNS_N3,
  303. MI_TRNS_N2,
  304. MI_TRNS_N1,
  305. MI_TRNS_0,
  306. MI_TRNS_1,
  307. MI_TRNS_2,
  308. MI_TRNS_3,
  309. MI_TRNS_4,
  310. MI_TRNS_5,
  311. MI_TRNS_6,
  312. MIDI_TRANSPOSE_MAX = MI_TRNS_6,
  313. MI_TRNSD, // transpose down
  314. MI_TRNSU, // transpose up
  315. MIDI_VELOCITY_MIN,
  316. MI_VEL_1 = MIDI_VELOCITY_MIN,
  317. MI_VEL_2,
  318. MI_VEL_3,
  319. MI_VEL_4,
  320. MI_VEL_5,
  321. MI_VEL_6,
  322. MI_VEL_7,
  323. MI_VEL_8,
  324. MI_VEL_9,
  325. MI_VEL_10,
  326. MIDI_VELOCITY_MAX = MI_VEL_10,
  327. MI_VELD, // velocity down
  328. MI_VELU, // velocity up
  329. MIDI_CHANNEL_MIN,
  330. MI_CH1 = MIDI_CHANNEL_MIN,
  331. MI_CH2,
  332. MI_CH3,
  333. MI_CH4,
  334. MI_CH5,
  335. MI_CH6,
  336. MI_CH7,
  337. MI_CH8,
  338. MI_CH9,
  339. MI_CH10,
  340. MI_CH11,
  341. MI_CH12,
  342. MI_CH13,
  343. MI_CH14,
  344. MI_CH15,
  345. MI_CH16,
  346. MIDI_CHANNEL_MAX = MI_CH16,
  347. MI_CHD, // previous channel
  348. MI_CHU, // next channel
  349. MI_ALLOFF, // all notes off
  350. MI_SUS, // sustain
  351. MI_PORT, // portamento
  352. MI_SOST, // sostenuto
  353. MI_SOFT, // soft pedal
  354. MI_LEG, // legato
  355. MI_MOD, // modulation
  356. MI_MODSD, // decrease modulation speed
  357. MI_MODSU, // increase modulation speed
  358. MI_BENDD, // Bend down
  359. MI_BENDU, // Bend up
  360. #endif // MIDI_ADVANCED
  361. // Backlight functionality
  362. BL_ON,
  363. BL_OFF,
  364. BL_DEC,
  365. BL_INC,
  366. BL_TOGG,
  367. BL_STEP,
  368. BL_BRTG,
  369. // RGB functionality
  370. RGB_TOG,
  371. RGB_MODE_FORWARD,
  372. RGB_MODE_REVERSE,
  373. RGB_HUI,
  374. RGB_HUD,
  375. RGB_SAI,
  376. RGB_SAD,
  377. RGB_VAI,
  378. RGB_VAD,
  379. RGB_SPI,
  380. RGB_SPD,
  381. RGB_MODE_PLAIN,
  382. RGB_MODE_BREATHE,
  383. RGB_MODE_RAINBOW,
  384. RGB_MODE_SWIRL,
  385. RGB_MODE_SNAKE,
  386. RGB_MODE_KNIGHT,
  387. RGB_MODE_XMAS,
  388. RGB_MODE_GRADIENT,
  389. RGB_MODE_RGBTEST,
  390. //Momentum matching toggle
  391. VLK_TOG,
  392. // Left shift, open paren
  393. KC_LSPO,
  394. // Right shift, close paren
  395. KC_RSPC,
  396. // Shift, Enter
  397. KC_SFTENT,
  398. // Printing
  399. PRINT_ON,
  400. PRINT_OFF,
  401. // output selection
  402. OUT_AUTO,
  403. OUT_USB,
  404. #ifdef BLUETOOTH_ENABLE
  405. OUT_BT,
  406. #endif
  407. #ifdef KEY_LOCK_ENABLE
  408. KC_LOCK,
  409. #endif
  410. #ifdef TERMINAL_ENABLE
  411. TERM_ON,
  412. TERM_OFF,
  413. #endif
  414. EEPROM_RESET,
  415. UNICODE_MODE_FORWARD,
  416. UNICODE_MODE_REVERSE,
  417. UNICODE_MODE_OSX,
  418. UNICODE_MODE_LNX,
  419. UNICODE_MODE_WIN,
  420. UNICODE_MODE_BSD,
  421. UNICODE_MODE_WINC,
  422. HPT_ON,
  423. HPT_OFF,
  424. HPT_TOG,
  425. HPT_RST,
  426. HPT_FBK,
  427. HPT_BUZ,
  428. HPT_MODI,
  429. HPT_MODD,
  430. HPT_DWLI,
  431. HPT_DWLD,
  432. // always leave at the end
  433. SAFE_RANGE
  434. };
  435. // Ability to use mods in layouts
  436. #define LCTL(kc) (QK_LCTL | (kc))
  437. #define LSFT(kc) (QK_LSFT | (kc))
  438. #define LALT(kc) (QK_LALT | (kc))
  439. #define LGUI(kc) (QK_LGUI | (kc))
  440. #define LCMD(kc) LGUI(kc)
  441. #define LWIN(kc) LGUI(kc)
  442. #define RCTL(kc) (QK_RCTL | (kc))
  443. #define RSFT(kc) (QK_RSFT | (kc))
  444. #define RALT(kc) (QK_RALT | (kc))
  445. #define ALGR(kc) RALT(kc)
  446. #define RGUI(kc) (QK_RGUI | (kc))
  447. #define RCMD(kc) RGUI(kc)
  448. #define RWIN(kc) RGUI(kc)
  449. #define HYPR(kc) (QK_LCTL | QK_LSFT | QK_LALT | QK_LGUI | (kc))
  450. #define MEH(kc) (QK_LCTL | QK_LSFT | QK_LALT | (kc))
  451. #define LCAG(kc) (QK_LCTL | QK_LALT | QK_LGUI | (kc))
  452. #define SGUI(kc) (QK_LGUI | QK_LSFT | (kc))
  453. #define SCMD(kc) SGUI(kc)
  454. #define SWIN(kc) SGUI(kc)
  455. #define LCA(kc) (QK_LCTL | QK_LALT | (kc))
  456. #define MOD_HYPR 0xF
  457. #define MOD_MEH 0x7
  458. // Aliases for shifted symbols
  459. // Each key has a 4-letter code, and some have longer aliases too.
  460. // While the long aliases are descriptive, the 4-letter codes
  461. // make for nicer grid layouts (everything lines up), and are
  462. // the preferred style for Quantum.
  463. #define KC_TILD LSFT(KC_GRV) // ~
  464. #define KC_TILDE KC_TILD
  465. #define KC_EXLM LSFT(KC_1) // !
  466. #define KC_EXCLAIM KC_EXLM
  467. #define KC_AT LSFT(KC_2) // @
  468. #define KC_HASH LSFT(KC_3) // #
  469. #define KC_DLR LSFT(KC_4) // $
  470. #define KC_DOLLAR KC_DLR
  471. #define KC_PERC LSFT(KC_5) // %
  472. #define KC_PERCENT KC_PERC
  473. #define KC_CIRC LSFT(KC_6) // ^
  474. #define KC_CIRCUMFLEX KC_CIRC
  475. #define KC_AMPR LSFT(KC_7) // &
  476. #define KC_AMPERSAND KC_AMPR
  477. #define KC_ASTR LSFT(KC_8) // *
  478. #define KC_ASTERISK KC_ASTR
  479. #define KC_LPRN LSFT(KC_9) // (
  480. #define KC_LEFT_PAREN KC_LPRN
  481. #define KC_RPRN LSFT(KC_0) // )
  482. #define KC_RIGHT_PAREN KC_RPRN
  483. #define KC_UNDS LSFT(KC_MINS) // _
  484. #define KC_UNDERSCORE KC_UNDS
  485. #define KC_PLUS LSFT(KC_EQL) // +
  486. #define KC_LCBR LSFT(KC_LBRC) // {
  487. #define KC_LEFT_CURLY_BRACE KC_LCBR
  488. #define KC_RCBR LSFT(KC_RBRC) // }
  489. #define KC_RIGHT_CURLY_BRACE KC_RCBR
  490. #define KC_LABK LSFT(KC_COMM) // <
  491. #define KC_LEFT_ANGLE_BRACKET KC_LABK
  492. #define KC_RABK LSFT(KC_DOT) // >
  493. #define KC_RIGHT_ANGLE_BRACKET KC_RABK
  494. #define KC_COLN LSFT(KC_SCLN) // :
  495. #define KC_COLON KC_COLN
  496. #define KC_PIPE LSFT(KC_BSLS) // |
  497. #define KC_LT LSFT(KC_COMM) // <
  498. #define KC_GT LSFT(KC_DOT) // >
  499. #define KC_QUES LSFT(KC_SLSH) // ?
  500. #define KC_QUESTION KC_QUES
  501. #define KC_DQT LSFT(KC_QUOT) // "
  502. #define KC_DOUBLE_QUOTE KC_DQT
  503. #define KC_DQUO KC_DQT
  504. #define KC_DELT KC_DELETE // Del key (four letter code)
  505. // Alias for function layers than expand past FN31
  506. #define FUNC(kc) (QK_FUNCTION | (kc))
  507. // Aliases
  508. #define C(kc) LCTL(kc)
  509. #define S(kc) LSFT(kc)
  510. #define A(kc) LALT(kc)
  511. #define G(kc) LGUI(kc)
  512. #define F(kc) FUNC(kc)
  513. #define M(kc) (QK_MACRO | (kc))
  514. #define MACROTAP(kc) (QK_MACRO | (FUNC_TAP << 8) | (kc))
  515. #define MACRODOWN(...) (record->event.pressed ? MACRO(__VA_ARGS__) : MACRO_NONE)
  516. #define KC_GESC GRAVE_ESC
  517. #define EEP_RST EEPROM_RESET
  518. #define CK_TOGG CLICKY_TOGGLE
  519. #define CK_RST CLICKY_RESET
  520. #define CK_UP CLICKY_UP
  521. #define CK_DOWN CLICKY_DOWN
  522. #define CK_ON CLICKY_ENABLE
  523. #define CK_OFF CLICKY_DISABLE
  524. #define RGB_MOD RGB_MODE_FORWARD
  525. #define RGB_RMOD RGB_MODE_REVERSE
  526. #define RGB_M_P RGB_MODE_PLAIN
  527. #define RGB_M_B RGB_MODE_BREATHE
  528. #define RGB_M_R RGB_MODE_RAINBOW
  529. #define RGB_M_SW RGB_MODE_SWIRL
  530. #define RGB_M_SN RGB_MODE_SNAKE
  531. #define RGB_M_K RGB_MODE_KNIGHT
  532. #define RGB_M_X RGB_MODE_XMAS
  533. #define RGB_M_G RGB_MODE_GRADIENT
  534. #define RGB_M_T RGB_MODE_RGBTEST
  535. // L-ayer, T-ap - 256 keycode max, 16 layer max
  536. #define LT(layer, kc) (QK_LAYER_TAP | (((layer) & 0xF) << 8) | ((kc) & 0xFF))
  537. #define AG_SWAP MAGIC_SWAP_ALT_GUI
  538. #define AG_NORM MAGIC_UNSWAP_ALT_GUI
  539. #define AG_TOGG MAGIC_TOGGLE_ALT_GUI
  540. // GOTO layer - 16 layers max
  541. // when:
  542. // ON_PRESS = 1
  543. // ON_RELEASE = 2
  544. // Unless you have a good reason not to do so, prefer ON_PRESS (1) as your default.
  545. // In fact, we changed it to assume ON_PRESS for sanity/simplicity. If needed, you can add your own
  546. // keycode modeled after the old version, kept below for this.
  547. /* #define TO(layer, when) (QK_TO | (when << 0x4) | (layer & 0xFF)) */
  548. #define TO(layer) (QK_TO | (ON_PRESS << 0x4) | ((layer) & 0xFF))
  549. // Momentary switch layer - 256 layer max
  550. #define MO(layer) (QK_MOMENTARY | ((layer) & 0xFF))
  551. // Set default layer - 256 layer max
  552. #define DF(layer) (QK_DEF_LAYER | ((layer) & 0xFF))
  553. // Toggle to layer - 256 layer max
  554. #define TG(layer) (QK_TOGGLE_LAYER | ((layer) & 0xFF))
  555. // One-shot layer - 256 layer max
  556. #define OSL(layer) (QK_ONE_SHOT_LAYER | ((layer) & 0xFF))
  557. // L-ayer M-od: Momentary switch layer with modifiers active - 16 layer max, left mods only
  558. #define LM(layer, mod) (QK_LAYER_MOD | (((layer) & 0xF) << 4) | ((mod) & 0xF))
  559. // One-shot mod
  560. #define OSM(mod) (QK_ONE_SHOT_MOD | ((mod) & 0xFF))
  561. // Layer tap-toggle
  562. #define TT(layer) (QK_LAYER_TAP_TOGGLE | ((layer) & 0xFF))
  563. // M-od, T-ap - 256 keycode max
  564. #define MT(mod, kc) (QK_MOD_TAP | (((mod) & 0x1F) << 8) | ((kc) & 0xFF))
  565. #define LCTL_T(kc) MT(MOD_LCTL, kc)
  566. #define RCTL_T(kc) MT(MOD_RCTL, kc)
  567. #define CTL_T(kc) LCTL_T(kc)
  568. #define LSFT_T(kc) MT(MOD_LSFT, kc)
  569. #define RSFT_T(kc) MT(MOD_RSFT, kc)
  570. #define SFT_T(kc) LSFT_T(kc)
  571. #define LALT_T(kc) MT(MOD_LALT, kc)
  572. #define RALT_T(kc) MT(MOD_RALT, kc)
  573. #define ALT_T(kc) LALT_T(kc)
  574. #define ALGR_T(kc) RALT_T(kc)
  575. #define LGUI_T(kc) MT(MOD_LGUI, kc)
  576. #define RGUI_T(kc) MT(MOD_RGUI, kc)
  577. #define LCMD_T(kc) LGUI_T(kc)
  578. #define LWIN_T(kc) LGUI_T(kc)
  579. #define RCMD_T(kc) RGUI_T(kc)
  580. #define RWIN_T(kc) RGUI_T(kc)
  581. #define GUI_T(kc) LGUI_T(kc)
  582. #define CMD_T(kc) LCMD_T(kc)
  583. #define WIN_T(kc) LWIN_T(kc)
  584. #define C_S_T(kc) MT(MOD_LCTL | MOD_LSFT, kc) // Left Control + Shift e.g. for gnome-terminal
  585. #define MEH_T(kc) MT(MOD_LCTL | MOD_LSFT | MOD_LALT, kc) // Meh is a less hyper version of the Hyper key -- doesn't include GUI, so just Left Control + Shift + Alt
  586. #define LCAG_T(kc) MT(MOD_LCTL | MOD_LALT | MOD_LGUI, kc) // Left Control + Alt + GUI
  587. #define RCAG_T(kc) MT(MOD_RCTL | MOD_RALT | MOD_RGUI, kc) // Right Control + Alt + GUI
  588. #define HYPR_T(kc) MT(MOD_LCTL | MOD_LSFT | MOD_LALT | MOD_LGUI, kc) // see http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/
  589. #define SGUI_T(kc) MT(MOD_LGUI | MOD_LSFT, kc) // Left Shift + GUI
  590. #define SCMD_T(kc) SGUI_T(kc)
  591. #define SWIN_T(kc) SGUI_T(kc)
  592. #define LCA_T(kc) MT(MOD_LCTL | MOD_LALT, kc) // Left Control + Alt
  593. #define ALL_T(kc) HYPR_T(kc)
  594. // Dedicated keycode versions for Hyper and Meh, if you want to use them as standalone keys rather than mod-tap
  595. #define KC_HYPR HYPR(KC_NO)
  596. #define KC_MEH MEH(KC_NO)
  597. #ifdef UNICODE_ENABLE
  598. // Allows Unicode input up to 0x7FFF
  599. #define UC(c) (QK_UNICODE | (c))
  600. #endif
  601. #ifdef UNICODEMAP_ENABLE
  602. // Allows Unicode input up to 0x10FFFF, requires unicode_map
  603. #define X(i) (QK_UNICODEMAP | (i))
  604. #endif
  605. #define UC_MOD UNICODE_MODE_FORWARD
  606. #define UC_RMOD UNICODE_MODE_REVERSE
  607. #define UC_M_OS UNICODE_MODE_OSX
  608. #define UC_M_LN UNICODE_MODE_LNX
  609. #define UC_M_WI UNICODE_MODE_WIN
  610. #define UC_M_BS UNICODE_MODE_BSD
  611. #define UC_M_WC UNICODE_MODE_WINC
  612. #ifdef SWAP_HANDS_ENABLE
  613. #define SH_T(kc) (QK_SWAP_HANDS | (kc))
  614. #define SH_TG (QK_SWAP_HANDS | OP_SH_TOGGLE)
  615. #define SH_TT (QK_SWAP_HANDS | OP_SH_TAP_TOGGLE)
  616. #define SH_MON (QK_SWAP_HANDS | OP_SH_ON_OFF)
  617. #define SH_MOFF (QK_SWAP_HANDS | OP_SH_OFF_ON)
  618. #define SH_ON (QK_SWAP_HANDS | OP_SH_ON)
  619. #define SH_OFF (QK_SWAP_HANDS | OP_SH_OFF)
  620. #endif
  621. #endif // QUANTUM_KEYCODES_H