Skip to content

Commit

Permalink
Align dynamic tapping term keycode names (#18963)
Browse files Browse the repository at this point in the history
* Align dynamic tapping term keycode names

* regen header
  • Loading branch information
zvecr authored Nov 5, 2022
1 parent 5233c69 commit fd4c3f4
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 19 deletions.
15 changes: 12 additions & 3 deletions data/constants/keycodes/keycodes_0.0.1_quantum.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -411,15 +411,24 @@

"0x7C70": {
"group": "quantum",
"key": "DT_PRNT"
"key": "QK_DYNAMIC_TAPPING_TERM_PRINT",
"aliases": [
"DT_PRNT"
]
},
"0x7C71": {
"group": "quantum",
"key": "DT_UP"
"key": "QK_DYNAMIC_TAPPING_TERM_UP",
"aliases": [
"DT_UP"
]
},
"0x7C72": {
"group": "quantum",
"key": "DT_DOWN"
"key": "QK_DYNAMIC_TAPPING_TERM_DOWN",
"aliases": [
"DT_DOWN"
]
},

"0x7C73": {
Expand Down
10 changes: 5 additions & 5 deletions docs/keycodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -669,11 +669,11 @@ See also: [Mod-Tap](mod_tap.md)

See also: [Dynamic Tapping Term](tap_hold#dynamic-tapping-term)

| Key | Description |
|-------------|------------------------------------------------------------------------------------------------------------------------|
| `DT_PRNT` | "Dynamic Tapping Term Print": Types the current tapping term, in milliseconds |
| `DT_UP` | "Dynamic Tapping Term Up": Increases the current tapping term by `DYNAMIC_TAPPING_TERM_INCREMENT`ms (5ms by default) |
| `DT_DOWN` | "Dynamic Tapping Term Down": Decreases the current tapping term by `DYNAMIC_TAPPING_TERM_INCREMENT`ms (5ms by default) |
| Key | Aliases | Description |
|-------------------------------|---------|-------------------------------------------------------------------------------------------|
|`QK_DYNAMIC_TAPPING_TERM_PRINT`|`DT_PRNT`| Types the current tapping term, in milliseconds |
|`QK_DYNAMIC_TAPPING_TERM_UP` |`DT_UP` | Increases the current tapping term by `DYNAMIC_TAPPING_TERM_INCREMENT`ms (5ms by default) |
|`QK_DYNAMIC_TAPPING_TERM_DOWN` |`DT_DOWN`| Decreases the current tapping term by `DYNAMIC_TAPPING_TERM_INCREMENT`ms (5ms by default) |

## RGB Lighting :id=rgb-lighting

Expand Down
10 changes: 5 additions & 5 deletions docs/tap_hold.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) {
`DYNAMIC_TAPPING_TERM_ENABLE` is a feature you can enable in `rules.mk` that lets you use three special keys in your keymap to configure the tapping term on the fly.
| Key | Description |
|-------------|------------------------------------------------------------------------------------------------------------------------|
| `DT_PRNT` | "Dynamic Tapping Term Print": Types the current tapping term, in milliseconds |
| `DT_UP` | "Dynamic Tapping Term Up": Increases the current tapping term by `DYNAMIC_TAPPING_TERM_INCREMENT`ms (5ms by default) |
| `DT_DOWN` | "Dynamic Tapping Term Down": Decreases the current tapping term by `DYNAMIC_TAPPING_TERM_INCREMENT`ms (5ms by default) |
| Key | Aliases | Description |
|-------------------------------|---------|-------------------------------------------------------------------------------------------|
|`QK_DYNAMIC_TAPPING_TERM_PRINT`|`DT_PRNT`| Types the current tapping term, in milliseconds |
|`QK_DYNAMIC_TAPPING_TERM_UP` |`DT_UP` | Increases the current tapping term by `DYNAMIC_TAPPING_TERM_INCREMENT`ms (5ms by default) |
|`QK_DYNAMIC_TAPPING_TERM_DOWN` |`DT_DOWN`| Decreases the current tapping term by `DYNAMIC_TAPPING_TERM_INCREMENT`ms (5ms by default) |
Set the tapping term as usual with `#define TAPPING_TERM <value>` in `config.h` and add `DYNAMIC_TAPPING_TERM_ENABLE = yes` in `rules.mk`. Then, place the above three keys somewhere in your keymap and flash the new firmware onto your board.
Expand Down
10 changes: 7 additions & 3 deletions quantum/keycodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -706,9 +706,9 @@ enum qk_keycode_defines {
QK_SECURE_UNLOCK = 0x7C61,
QK_SECURE_TOGGLE = 0x7C62,
QK_SECURE_REQUEST = 0x7C63,
DT_PRNT = 0x7C70,
DT_UP = 0x7C71,
DT_DOWN = 0x7C72,
QK_DYNAMIC_TAPPING_TERM_PRINT = 0x7C70,
QK_DYNAMIC_TAPPING_TERM_UP = 0x7C71,
QK_DYNAMIC_TAPPING_TERM_DOWN = 0x7C72,
QK_CAPS_WORD_TOGGLE = 0x7C73,
QK_AUTOCORRECT_ON = 0x7C74,
QK_AUTOCORRECT_OFF = 0x7C75,
Expand Down Expand Up @@ -1088,6 +1088,9 @@ enum qk_keycode_defines {
SE_UNLK = QK_SECURE_UNLOCK,
SE_TOGG = QK_SECURE_TOGGLE,
SE_REQ = QK_SECURE_REQUEST,
DT_PRNT = QK_DYNAMIC_TAPPING_TERM_PRINT,
DT_UP = QK_DYNAMIC_TAPPING_TERM_UP,
DT_DOWN = QK_DYNAMIC_TAPPING_TERM_DOWN,
CW_TOGG = QK_CAPS_WORD_TOGGLE,
AC_ON = QK_AUTOCORRECT_ON,
AC_OFF = QK_AUTOCORRECT_OFF,
Expand Down Expand Up @@ -1142,3 +1145,4 @@ enum qk_keycode_defines {
#define IS_BACKLIGHT_KEYCODE(code) ((code) >= BL_ON && (code) <= BL_BRTG)
#define IS_RGB_KEYCODE(code) ((code) >= RGB_TOG && (code) <= RGB_MODE_TWINKLE)
#define IS_QUANTUM_KEYCODE(code) ((code) >= QK_BOOTLOADER && (code) <= QK_AUTOCORRECT_TOGGLE)

6 changes: 3 additions & 3 deletions quantum/process_keycode/process_dynamic_tapping_term.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ static void tapping_term_report(void) {
bool process_dynamic_tapping_term(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
switch (keycode) {
case DT_PRNT:
case QK_DYNAMIC_TAPPING_TERM_PRINT:
tapping_term_report();
return false;

case DT_UP:
case QK_DYNAMIC_TAPPING_TERM_UP:
g_tapping_term += DYNAMIC_TAPPING_TERM_INCREMENT;
return false;

case DT_DOWN:
case QK_DYNAMIC_TAPPING_TERM_DOWN:
g_tapping_term -= DYNAMIC_TAPPING_TERM_INCREMENT;
return false;
}
Expand Down

0 comments on commit fd4c3f4

Please sign in to comment.