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.

811 lines
19 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
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 shortcuts - not to be used directly
  31. QK_BASIC = 0x0000,
  32. QK_BASIC_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 = 0xBFFF,
  87. QK_UNICODEMAP_PAIR = 0xC000,
  88. QK_UNICODEMAP_PAIR_MAX = 0xFFFF,
  89. #endif
  90. // Loose keycodes - to be used directly
  91. RESET = 0x5C00,
  92. DEBUG,
  93. MAGIC_SWAP_CONTROL_CAPSLOCK,
  94. MAGIC_CAPSLOCK_TO_CONTROL,
  95. MAGIC_SWAP_LALT_LGUI,
  96. MAGIC_SWAP_RALT_RGUI,
  97. MAGIC_NO_GUI,
  98. MAGIC_SWAP_GRAVE_ESC,
  99. MAGIC_SWAP_BACKSLASH_BACKSPACE,
  100. MAGIC_HOST_NKRO,
  101. MAGIC_SWAP_ALT_GUI,
  102. MAGIC_UNSWAP_CONTROL_CAPSLOCK,
  103. MAGIC_UNCAPSLOCK_TO_CONTROL,
  104. MAGIC_UNSWAP_LALT_LGUI,
  105. MAGIC_UNSWAP_RALT_RGUI,
  106. MAGIC_UNNO_GUI,
  107. MAGIC_UNSWAP_GRAVE_ESC,
  108. MAGIC_UNSWAP_BACKSLASH_BACKSPACE,
  109. MAGIC_UNHOST_NKRO,
  110. MAGIC_UNSWAP_ALT_GUI,
  111. MAGIC_TOGGLE_NKRO,
  112. MAGIC_TOGGLE_ALT_GUI,
  113. GRAVE_ESC,
  114. // Leader key
  115. #ifdef LEADER_ENABLE
  116. KC_LEAD,
  117. #endif
  118. // Auto Shift setup
  119. KC_ASUP,
  120. KC_ASDN,
  121. KC_ASRP,
  122. KC_ASTG,
  123. KC_ASON,
  124. KC_ASOFF,
  125. // Audio on/off/toggle
  126. AU_ON,
  127. AU_OFF,
  128. AU_TOG,
  129. // Faux clicky as part of main audio feature
  130. CLICKY_TOGGLE,
  131. CLICKY_ENABLE,
  132. CLICKY_DISABLE,
  133. CLICKY_UP,
  134. CLICKY_DOWN,
  135. CLICKY_RESET,
  136. #ifdef FAUXCLICKY_ENABLE
  137. // Faux clicky
  138. FC_ON,
  139. FC_OFF,
  140. FC_TOG,
  141. #endif
  142. // Music mode on/off/toggle
  143. MU_ON,
  144. MU_OFF,
  145. MU_TOG,
  146. // Music mode cycle
  147. MU_MOD,
  148. // Music voice iterate
  149. MUV_IN,
  150. MUV_DE,
  151. // Midi
  152. #if !MIDI_ENABLE_STRICT || (defined(MIDI_ENABLE) && defined(MIDI_BASIC))
  153. MI_ON,
  154. MI_OFF,
  155. MI_TOG,
  156. #endif
  157. #if !MIDI_ENABLE_STRICT || (defined(MIDI_ENABLE) && defined(MIDI_ADVANCED))
  158. MIDI_TONE_MIN,
  159. # if !MIDI_ENABLE_STRICT || MIDI_TONE_KEYCODE_OCTAVES > 0
  160. MI_C = MIDI_TONE_MIN,
  161. MI_Cs,
  162. MI_Db = MI_Cs,
  163. MI_D,
  164. MI_Ds,
  165. MI_Eb = MI_Ds,
  166. MI_E,
  167. MI_F,
  168. MI_Fs,
  169. MI_Gb = MI_Fs,
  170. MI_G,
  171. MI_Gs,
  172. MI_Ab = MI_Gs,
  173. MI_A,
  174. MI_As,
  175. MI_Bb = MI_As,
  176. MI_B,
  177. # endif
  178. # if !MIDI_ENABLE_STRICT || MIDI_TONE_KEYCODE_OCTAVES > 1
  179. MI_C_1,
  180. MI_Cs_1,
  181. MI_Db_1 = MI_Cs_1,
  182. MI_D_1,
  183. MI_Ds_1,
  184. MI_Eb_1 = MI_Ds_1,
  185. MI_E_1,
  186. MI_F_1,
  187. MI_Fs_1,
  188. MI_Gb_1 = MI_Fs_1,
  189. MI_G_1,
  190. MI_Gs_1,
  191. MI_Ab_1 = MI_Gs_1,
  192. MI_A_1,
  193. MI_As_1,
  194. MI_Bb_1 = MI_As_1,
  195. MI_B_1,
  196. # endif
  197. # if !MIDI_ENABLE_STRICT || MIDI_TONE_KEYCODE_OCTAVES > 2
  198. MI_C_2,
  199. MI_Cs_2,
  200. MI_Db_2 = MI_Cs_2,
  201. MI_D_2,
  202. MI_Ds_2,
  203. MI_Eb_2 = MI_Ds_2,
  204. MI_E_2,
  205. MI_F_2,
  206. MI_Fs_2,
  207. MI_Gb_2 = MI_Fs_2,
  208. MI_G_2,
  209. MI_Gs_2,
  210. MI_Ab_2 = MI_Gs_2,
  211. MI_A_2,
  212. MI_As_2,
  213. MI_Bb_2 = MI_As_2,
  214. MI_B_2,
  215. # endif
  216. # if !MIDI_ENABLE_STRICT || MIDI_TONE_KEYCODE_OCTAVES > 3
  217. MI_C_3,
  218. MI_Cs_3,
  219. MI_Db_3 = MI_Cs_3,
  220. MI_D_3,
  221. MI_Ds_3,
  222. MI_Eb_3 = MI_Ds_3,
  223. MI_E_3,
  224. MI_F_3,
  225. MI_Fs_3,
  226. MI_Gb_3 = MI_Fs_3,
  227. MI_G_3,
  228. MI_Gs_3,
  229. MI_Ab_3 = MI_Gs_3,
  230. MI_A_3,
  231. MI_As_3,
  232. MI_Bb_3 = MI_As_3,
  233. MI_B_3,
  234. # endif
  235. # if !MIDI_ENABLE_STRICT || MIDI_TONE_KEYCODE_OCTAVES > 4
  236. MI_C_4,
  237. MI_Cs_4,
  238. MI_Db_4 = MI_Cs_4,
  239. MI_D_4,
  240. MI_Ds_4,
  241. MI_Eb_4 = MI_Ds_4,
  242. MI_E_4,
  243. MI_F_4,
  244. MI_Fs_4,
  245. MI_Gb_4 = MI_Fs_4,
  246. MI_G_4,
  247. MI_Gs_4,
  248. MI_Ab_4 = MI_Gs_4,
  249. MI_A_4,
  250. MI_As_4,
  251. MI_Bb_4 = MI_As_4,
  252. MI_B_4,
  253. # endif
  254. # if !MIDI_ENABLE_STRICT || MIDI_TONE_KEYCODE_OCTAVES > 5
  255. MI_C_5,
  256. MI_Cs_5,
  257. MI_Db_5 = MI_Cs_5,
  258. MI_D_5,
  259. MI_Ds_5,
  260. MI_Eb_5 = MI_Ds_5,
  261. MI_E_5,
  262. MI_F_5,
  263. MI_Fs_5,
  264. MI_Gb_5 = MI_Fs_5,
  265. MI_G_5,
  266. MI_Gs_5,
  267. MI_Ab_5 = MI_Gs_5,
  268. MI_A_5,
  269. MI_As_5,
  270. MI_Bb_5 = MI_As_5,
  271. MI_B_5,
  272. # endif
  273. # if !MIDI_ENABLE_STRICT || MIDI_TONE_KEYCODE_OCTAVES > 5
  274. MIDI_TONE_MAX = MI_B_5,
  275. # elif MIDI_TONE_KEYCODE_OCTAVES > 4
  276. MIDI_TONE_MAX = MI_B_4,
  277. # elif MIDI_TONE_KEYCODE_OCTAVES > 3
  278. MIDI_TONE_MAX = MI_B_3,
  279. # elif MIDI_TONE_KEYCODE_OCTAVES > 2
  280. MIDI_TONE_MAX = MI_B_2,
  281. # elif MIDI_TONE_KEYCODE_OCTAVES > 1
  282. MIDI_TONE_MAX = MI_B_1,
  283. # elif MIDI_TONE_KEYCODE_OCTAVES > 0
  284. MIDI_TONE_MAX = MI_B,
  285. # endif
  286. MIDI_OCTAVE_MIN,
  287. MI_OCT_N2 = MIDI_OCTAVE_MIN,
  288. MI_OCT_N1,
  289. MI_OCT_0,
  290. MI_OCT_1,
  291. MI_OCT_2,
  292. MI_OCT_3,
  293. MI_OCT_4,
  294. MI_OCT_5,
  295. MI_OCT_6,
  296. MI_OCT_7,
  297. MIDI_OCTAVE_MAX = MI_OCT_7,
  298. MI_OCTD, // octave down
  299. MI_OCTU, // octave up
  300. MIDI_TRANSPOSE_MIN,
  301. MI_TRNS_N6 = MIDI_TRANSPOSE_MIN,
  302. MI_TRNS_N5,
  303. MI_TRNS_N4,
  304. MI_TRNS_N3,
  305. MI_TRNS_N2,
  306. MI_TRNS_N1,
  307. MI_TRNS_0,
  308. MI_TRNS_1,
  309. MI_TRNS_2,
  310. MI_TRNS_3,
  311. MI_TRNS_4,
  312. MI_TRNS_5,
  313. MI_TRNS_6,
  314. MIDI_TRANSPOSE_MAX = MI_TRNS_6,
  315. MI_TRNSD, // transpose down
  316. MI_TRNSU, // transpose up
  317. MIDI_VELOCITY_MIN,
  318. MI_VEL_1 = MIDI_VELOCITY_MIN,
  319. MI_VEL_2,
  320. MI_VEL_3,
  321. MI_VEL_4,
  322. MI_VEL_5,
  323. MI_VEL_6,
  324. MI_VEL_7,
  325. MI_VEL_8,
  326. MI_VEL_9,
  327. MI_VEL_10,
  328. MIDI_VELOCITY_MAX = MI_VEL_10,
  329. MI_VELD, // velocity down
  330. MI_VELU, // velocity up
  331. MIDI_CHANNEL_MIN,
  332. MI_CH1 = MIDI_CHANNEL_MIN,
  333. MI_CH2,
  334. MI_CH3,
  335. MI_CH4,
  336. MI_CH5,
  337. MI_CH6,
  338. MI_CH7,
  339. MI_CH8,
  340. MI_CH9,
  341. MI_CH10,
  342. MI_CH11,
  343. MI_CH12,
  344. MI_CH13,
  345. MI_CH14,
  346. MI_CH15,
  347. MI_CH16,
  348. MIDI_CHANNEL_MAX = MI_CH16,
  349. MI_CHD, // previous channel
  350. MI_CHU, // next channel
  351. MI_ALLOFF, // all notes off
  352. MI_SUS, // sustain
  353. MI_PORT, // portamento
  354. MI_SOST, // sostenuto
  355. MI_SOFT, // soft pedal
  356. MI_LEG, // legato
  357. MI_MOD, // modulation
  358. MI_MODSD, // decrease modulation speed
  359. MI_MODSU, // increase modulation speed
  360. MI_BENDD, // Bend down
  361. MI_BENDU, // Bend up
  362. #endif // MIDI_ADVANCED
  363. // Backlight functionality
  364. BL_ON,
  365. BL_OFF,
  366. BL_DEC,
  367. BL_INC,
  368. BL_TOGG,
  369. BL_STEP,
  370. BL_BRTG,
  371. // RGB functionality
  372. RGB_TOG,
  373. RGB_MODE_FORWARD,
  374. RGB_MODE_REVERSE,
  375. RGB_HUI,
  376. RGB_HUD,
  377. RGB_SAI,
  378. RGB_SAD,
  379. RGB_VAI,
  380. RGB_VAD,
  381. RGB_SPI,
  382. RGB_SPD,
  383. RGB_MODE_PLAIN,
  384. RGB_MODE_BREATHE,
  385. RGB_MODE_RAINBOW,
  386. RGB_MODE_SWIRL,
  387. RGB_MODE_SNAKE,
  388. RGB_MODE_KNIGHT,
  389. RGB_MODE_XMAS,
  390. RGB_MODE_GRADIENT,
  391. RGB_MODE_RGBTEST,
  392. // Momentum matching toggle
  393. VLK_TOG,
  394. // Left shift, open paren
  395. KC_LSPO,
  396. // Right shift, close paren
  397. KC_RSPC,
  398. // Shift, Enter
  399. KC_SFTENT,
  400. // Printing
  401. PRINT_ON,
  402. PRINT_OFF,
  403. // output selection
  404. OUT_AUTO,
  405. OUT_USB,
  406. #ifdef BLUETOOTH_ENABLE
  407. OUT_BT,
  408. #endif
  409. #ifdef KEY_LOCK_ENABLE
  410. KC_LOCK,
  411. #endif
  412. #ifdef TERMINAL_ENABLE
  413. TERM_ON,
  414. TERM_OFF,
  415. #endif
  416. EEPROM_RESET,
  417. UNICODE_MODE_FORWARD,
  418. UNICODE_MODE_REVERSE,
  419. UNICODE_MODE_MAC,
  420. UNICODE_MODE_LNX,
  421. UNICODE_MODE_WIN,
  422. UNICODE_MODE_BSD,
  423. UNICODE_MODE_WINC,
  424. HPT_ON,
  425. HPT_OFF,
  426. HPT_TOG,
  427. HPT_RST,
  428. HPT_FBK,
  429. HPT_BUZ,
  430. HPT_MODI,
  431. HPT_MODD,
  432. HPT_CONT,
  433. HPT_CONI,
  434. HPT_COND,
  435. HPT_DWLI,
  436. HPT_DWLD,
  437. // Left control, open paren
  438. KC_LCPO,
  439. // Right control, close paren
  440. KC_RCPC,
  441. // Left control, open paren
  442. KC_LAPO,
  443. // Right control, close paren
  444. KC_RAPC,
  445. CMB_ON,
  446. CMB_OFF,
  447. CMB_TOG,
  448. MAGIC_SWAP_LCTL_LGUI,
  449. MAGIC_SWAP_RCTL_RGUI,
  450. MAGIC_UNSWAP_LCTL_LGUI,
  451. MAGIC_UNSWAP_RCTL_RGUI,
  452. MAGIC_SWAP_CTL_GUI,
  453. MAGIC_UNSWAP_CTL_GUI,
  454. MAGIC_TOGGLE_CTL_GUI,
  455. MAGIC_EE_HANDS_LEFT,
  456. MAGIC_EE_HANDS_RIGHT,
  457. // Dynamic Macros
  458. DYN_REC_START1,
  459. DYN_REC_START2,
  460. DYN_REC_STOP,
  461. DYN_MACRO_PLAY1,
  462. DYN_MACRO_PLAY2,
  463. // always leave at the end
  464. SAFE_RANGE
  465. };
  466. // Ability to use mods in layouts
  467. #define LCTL(kc) (QK_LCTL | (kc))
  468. #define LSFT(kc) (QK_LSFT | (kc))
  469. #define LALT(kc) (QK_LALT | (kc))
  470. #define LGUI(kc) (QK_LGUI | (kc))
  471. #define LOPT(kc) LALT(kc)
  472. #define LCMD(kc) LGUI(kc)
  473. #define LWIN(kc) LGUI(kc)
  474. #define RCTL(kc) (QK_RCTL | (kc))
  475. #define RSFT(kc) (QK_RSFT | (kc))
  476. #define RALT(kc) (QK_RALT | (kc))
  477. #define RGUI(kc) (QK_RGUI | (kc))
  478. #define ALGR(kc) RALT(kc)
  479. #define ROPT(kc) RALT(kc)
  480. #define RCMD(kc) RGUI(kc)
  481. #define RWIN(kc) RGUI(kc)
  482. #define HYPR(kc) (QK_LCTL | QK_LSFT | QK_LALT | QK_LGUI | (kc))
  483. #define MEH(kc) (QK_LCTL | QK_LSFT | QK_LALT | (kc))
  484. #define LCAG(kc) (QK_LCTL | QK_LALT | QK_LGUI | (kc))
  485. #define SGUI(kc) (QK_LGUI | QK_LSFT | (kc))
  486. #define SCMD(kc) SGUI(kc)
  487. #define SWIN(kc) SGUI(kc)
  488. #define LCA(kc) (QK_LCTL | QK_LALT | (kc))
  489. #define MOD_HYPR 0xF
  490. #define MOD_MEH 0x7
  491. // Aliases for shifted symbols
  492. // Each key has a 4-letter code, and some have longer aliases too.
  493. // While the long aliases are descriptive, the 4-letter codes
  494. // make for nicer grid layouts (everything lines up), and are
  495. // the preferred style for Quantum.
  496. #define KC_TILD LSFT(KC_GRV) // ~
  497. #define KC_TILDE KC_TILD
  498. #define KC_EXLM LSFT(KC_1) // !
  499. #define KC_EXCLAIM KC_EXLM
  500. #define KC_AT LSFT(KC_2) // @
  501. #define KC_HASH LSFT(KC_3) // #
  502. #define KC_DLR LSFT(KC_4) // $
  503. #define KC_DOLLAR KC_DLR
  504. #define KC_PERC LSFT(KC_5) // %
  505. #define KC_PERCENT KC_PERC
  506. #define KC_CIRC LSFT(KC_6) // ^
  507. #define KC_CIRCUMFLEX KC_CIRC
  508. #define KC_AMPR LSFT(KC_7) // &
  509. #define KC_AMPERSAND KC_AMPR
  510. #define KC_ASTR LSFT(KC_8) // *
  511. #define KC_ASTERISK KC_ASTR
  512. #define KC_LPRN LSFT(KC_9) // (
  513. #define KC_LEFT_PAREN KC_LPRN
  514. #define KC_RPRN LSFT(KC_0) // )
  515. #define KC_RIGHT_PAREN KC_RPRN
  516. #define KC_UNDS LSFT(KC_MINS) // _
  517. #define KC_UNDERSCORE KC_UNDS
  518. #define KC_PLUS LSFT(KC_EQL) // +
  519. #define KC_LCBR LSFT(KC_LBRC) // {
  520. #define KC_LEFT_CURLY_BRACE KC_LCBR
  521. #define KC_RCBR LSFT(KC_RBRC) // }
  522. #define KC_RIGHT_CURLY_BRACE KC_RCBR
  523. #define KC_LABK LSFT(KC_COMM) // <
  524. #define KC_LEFT_ANGLE_BRACKET KC_LABK
  525. #define KC_RABK LSFT(KC_DOT) // >
  526. #define KC_RIGHT_ANGLE_BRACKET KC_RABK
  527. #define KC_COLN LSFT(KC_SCLN) // :
  528. #define KC_COLON KC_COLN
  529. #define KC_PIPE LSFT(KC_BSLS) // |
  530. #define KC_LT LSFT(KC_COMM) // <
  531. #define KC_GT LSFT(KC_DOT) // >
  532. #define KC_QUES LSFT(KC_SLSH) // ?
  533. #define KC_QUESTION KC_QUES
  534. #define KC_DQT LSFT(KC_QUOT) // "
  535. #define KC_DOUBLE_QUOTE KC_DQT
  536. #define KC_DQUO KC_DQT
  537. #define KC_DELT KC_DELETE // Del key (four letter code)
  538. // Alias for function layers than expand past FN31
  539. #define FUNC(kc) (QK_FUNCTION | (kc))
  540. // Aliases
  541. #define C(kc) LCTL(kc)
  542. #define S(kc) LSFT(kc)
  543. #define A(kc) LALT(kc)
  544. #define G(kc) LGUI(kc)
  545. #define F(kc) FUNC(kc)
  546. #define M(kc) (QK_MACRO | (kc))
  547. #define MACROTAP(kc) (QK_MACRO | (FUNC_TAP << 8) | (kc))
  548. #define MACRODOWN(...) (record->event.pressed ? MACRO(__VA_ARGS__) : MACRO_NONE)
  549. #define KC_GESC GRAVE_ESC
  550. #define EEP_RST EEPROM_RESET
  551. #define CK_TOGG CLICKY_TOGGLE
  552. #define CK_RST CLICKY_RESET
  553. #define CK_UP CLICKY_UP
  554. #define CK_DOWN CLICKY_DOWN
  555. #define CK_ON CLICKY_ENABLE
  556. #define CK_OFF CLICKY_DISABLE
  557. #define RGB_MOD RGB_MODE_FORWARD
  558. #define RGB_RMOD RGB_MODE_REVERSE
  559. #define RGB_M_P RGB_MODE_PLAIN
  560. #define RGB_M_B RGB_MODE_BREATHE
  561. #define RGB_M_R RGB_MODE_RAINBOW
  562. #define RGB_M_SW RGB_MODE_SWIRL
  563. #define RGB_M_SN RGB_MODE_SNAKE
  564. #define RGB_M_K RGB_MODE_KNIGHT
  565. #define RGB_M_X RGB_MODE_XMAS
  566. #define RGB_M_G RGB_MODE_GRADIENT
  567. #define RGB_M_T RGB_MODE_RGBTEST
  568. // L-ayer, T-ap - 256 keycode max, 16 layer max
  569. #define LT(layer, kc) (QK_LAYER_TAP | (((layer)&0xF) << 8) | ((kc)&0xFF))
  570. #define CL_SWAP MAGIC_SWAP_CONTROL_CAPSLOCK
  571. #define CL_NORM MAGIC_UNSWAP_CONTROL_CAPSLOCK
  572. #define CL_CTRL MAGIC_CAPSLOCK_TO_CONTROL
  573. #define CL_CAPS MAGIC_UNCAPSLOCK_TO_CONTROL
  574. #define LCG_SWP MAGIC_SWAP_LCTL_LGUI
  575. #define LCG_NRM MAGIC_UNSWAP_LCTL_LGUI
  576. #define RCG_SWP MAGIC_SWAP_RCTL_RGUI
  577. #define RCG_NRM MAGIC_UNSWAP_RCTL_RGUI
  578. #define CG_SWAP MAGIC_SWAP_CTL_GUI
  579. #define CG_NORM MAGIC_UNSWAP_CTL_GUI
  580. #define CG_TOGG MAGIC_TOGGLE_CTL_GUI
  581. #define LAG_SWP MAGIC_SWAP_LALT_LGUI
  582. #define LAG_NRM MAGIC_UNSWAP_LALT_LGUI
  583. #define RAG_SWP MAGIC_SWAP_RALT_RGUI
  584. #define RAG_NRM MAGIC_UNSWAP_RALT_RGUI
  585. #define AG_SWAP MAGIC_SWAP_ALT_GUI
  586. #define AG_NORM MAGIC_UNSWAP_ALT_GUI
  587. #define AG_TOGG MAGIC_TOGGLE_ALT_GUI
  588. #define GUI_OFF MAGIC_NO_GUI
  589. #define GUI_ON MAGIC_UNNO_GUI
  590. #define GE_SWAP MAGIC_SWAP_GRAVE_ESC
  591. #define GE_NORM MAGIC_UNSWAP_GRAVE_ESC
  592. #define BS_SWAP MAGIC_SWAP_BACKSLASH_BACKSPACE
  593. #define BS_NORM MAGIC_UNSWAP_BACKSLASH_BACKSPACE
  594. #define NK_ON MAGIC_HOST_NKRO
  595. #define NK_OFF MAGIC_UNHOST_NKRO
  596. #define NK_TOGG MAGIC_TOGGLE_NKRO
  597. #define EH_LEFT MAGIC_EE_HANDS_LEFT
  598. #define EH_RGHT MAGIC_EE_HANDS_RIGHT
  599. // GOTO layer - 16 layers max
  600. // when:
  601. // ON_PRESS = 1
  602. // ON_RELEASE = 2
  603. // Unless you have a good reason not to do so, prefer ON_PRESS (1) as your default.
  604. // In fact, we changed it to assume ON_PRESS for sanity/simplicity. If needed, you can add your own
  605. // keycode modeled after the old version, kept below for this.
  606. /* #define TO(layer, when) (QK_TO | (when << 0x4) | (layer & 0xFF)) */
  607. #define TO(layer) (QK_TO | (ON_PRESS << 0x4) | ((layer)&0xFF))
  608. // Momentary switch layer - 256 layer max
  609. #define MO(layer) (QK_MOMENTARY | ((layer)&0xFF))
  610. // Set default layer - 256 layer max
  611. #define DF(layer) (QK_DEF_LAYER | ((layer)&0xFF))
  612. // Toggle to layer - 256 layer max
  613. #define TG(layer) (QK_TOGGLE_LAYER | ((layer)&0xFF))
  614. // One-shot layer - 256 layer max
  615. #define OSL(layer) (QK_ONE_SHOT_LAYER | ((layer)&0xFF))
  616. // L-ayer M-od: Momentary switch layer with modifiers active - 16 layer max, left mods only
  617. #define LM(layer, mod) (QK_LAYER_MOD | (((layer)&0xF) << 4) | ((mod)&0xF))
  618. // One-shot mod
  619. #define OSM(mod) (QK_ONE_SHOT_MOD | ((mod)&0xFF))
  620. // Layer tap-toggle
  621. #define TT(layer) (QK_LAYER_TAP_TOGGLE | ((layer)&0xFF))
  622. // M-od, T-ap - 256 keycode max
  623. #define MT(mod, kc) (QK_MOD_TAP | (((mod)&0x1F) << 8) | ((kc)&0xFF))
  624. #define LCTL_T(kc) MT(MOD_LCTL, kc)
  625. #define RCTL_T(kc) MT(MOD_RCTL, kc)
  626. #define CTL_T(kc) LCTL_T(kc)
  627. #define LSFT_T(kc) MT(MOD_LSFT, kc)
  628. #define RSFT_T(kc) MT(MOD_RSFT, kc)
  629. #define SFT_T(kc) LSFT_T(kc)
  630. #define LALT_T(kc) MT(MOD_LALT, kc)
  631. #define RALT_T(kc) MT(MOD_RALT, kc)
  632. #define LOPT_T(kc) LALT_T(kc)
  633. #define ROPT_T(kc) RALT_T(kc)
  634. #define ALGR_T(kc) RALT_T(kc)
  635. #define ALT_T(kc) LALT_T(kc)
  636. #define OPT_T(kc) LOPT_T(kc)
  637. #define LGUI_T(kc) MT(MOD_LGUI, kc)
  638. #define RGUI_T(kc) MT(MOD_RGUI, kc)
  639. #define LCMD_T(kc) LGUI_T(kc)
  640. #define LWIN_T(kc) LGUI_T(kc)
  641. #define RCMD_T(kc) RGUI_T(kc)
  642. #define RWIN_T(kc) RGUI_T(kc)
  643. #define GUI_T(kc) LGUI_T(kc)
  644. #define CMD_T(kc) LCMD_T(kc)
  645. #define WIN_T(kc) LWIN_T(kc)
  646. #define C_S_T(kc) MT(MOD_LCTL | MOD_LSFT, kc) // Left Control + Shift e.g. for gnome-terminal
  647. #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
  648. #define LCAG_T(kc) MT(MOD_LCTL | MOD_LALT | MOD_LGUI, kc) // Left Control + Alt + GUI
  649. #define RCAG_T(kc) MT(MOD_RCTL | MOD_RALT | MOD_RGUI, kc) // Right Control + Alt + GUI
  650. #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/
  651. #define SGUI_T(kc) MT(MOD_LGUI | MOD_LSFT, kc) // Left Shift + GUI
  652. #define SCMD_T(kc) SGUI_T(kc)
  653. #define SWIN_T(kc) SGUI_T(kc)
  654. #define LCA_T(kc) MT(MOD_LCTL | MOD_LALT, kc) // Left Control + Alt
  655. #define ALL_T(kc) HYPR_T(kc)
  656. // Dedicated keycode versions for Hyper and Meh, if you want to use them as standalone keys rather than mod-tap
  657. #define KC_HYPR HYPR(KC_NO)
  658. #define KC_MEH MEH(KC_NO)
  659. #ifdef UNICODE_ENABLE
  660. // Allows Unicode input up to 0x7FFF
  661. # define UC(c) (QK_UNICODE | (c))
  662. #endif
  663. #ifdef UNICODEMAP_ENABLE
  664. // Allows Unicode input up to 0x10FFFF, requires unicode_map
  665. # define X(i) (QK_UNICODEMAP | (i))
  666. # define XP(i, j) (QK_UNICODEMAP_PAIR | ((i)&0x7F) | (((j)&0x7F) << 7)) // 127 max i and j
  667. #endif
  668. #define UC_MOD UNICODE_MODE_FORWARD
  669. #define UC_RMOD UNICODE_MODE_REVERSE
  670. #define UC_M_MA UNICODE_MODE_MAC
  671. #define UNICODE_MODE_OSX UNICODE_MODE_MAC // Deprecated alias
  672. #define UC_M_OS UNICODE_MODE_MAC // Deprecated alias
  673. #define UC_M_LN UNICODE_MODE_LNX
  674. #define UC_M_WI UNICODE_MODE_WIN
  675. #define UC_M_BS UNICODE_MODE_BSD
  676. #define UC_M_WC UNICODE_MODE_WINC
  677. #ifdef SWAP_HANDS_ENABLE
  678. # define SH_T(kc) (QK_SWAP_HANDS | (kc))
  679. # define SH_TG (QK_SWAP_HANDS | OP_SH_TOGGLE)
  680. # define SH_TT (QK_SWAP_HANDS | OP_SH_TAP_TOGGLE)
  681. # define SH_OS (QK_SWAP_HANDS | OP_SH_ONESHOT)
  682. # define SH_MON (QK_SWAP_HANDS | OP_SH_ON_OFF)
  683. # define SH_MOFF (QK_SWAP_HANDS | OP_SH_OFF_ON)
  684. # define SH_ON (QK_SWAP_HANDS | OP_SH_ON)
  685. # define SH_OFF (QK_SWAP_HANDS | OP_SH_OFF)
  686. #endif
  687. // Dynamic Macros aliases
  688. #define DM_REC1 DYN_REC_START1
  689. #define DM_REC2 DYN_REC_START2
  690. #define DM_RSTP DYN_REC_STOP
  691. #define DM_PLY1 DYN_MACRO_PLAY1
  692. #define DM_PLY2 DYN_MACRO_PLAY2
  693. #endif // QUANTUM_KEYCODES_H