Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[New Feature] Key Overrides #11422

Merged
merged 41 commits into from
Jul 13, 2021
Merged
Show file tree
Hide file tree
Changes from 39 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
fbff86d
Add key overrides feature
JonasGessner Dec 31, 2020
29a5743
Move various options to separate bitfields, add GPL license strings, …
JonasGessner Jan 1, 2021
d266b43
Make tmk additions private so that they do not get wrongly used
JonasGessner Jan 1, 2021
045010e
Fixes for refactor
JonasGessner Jan 1, 2021
463cb36
Do not activate already active override
JonasGessner Jan 1, 2021
ffe771d
Various simplifications, stricter rules
JonasGessner Jan 1, 2021
68c8f1a
Deactivate active even when the trigger key is pressed down again
JonasGessner Jan 2, 2021
6e92277
Unify option bitfields of key override
JonasGessner Jan 2, 2021
0f75730
Small fixes
JonasGessner Jan 2, 2021
88d6da8
Ensure key override trigger key is not reregistered on deactivation i…
JonasGessner Jan 2, 2021
cc8cf2f
Add deferred key reregistering
JonasGessner Jan 2, 2021
4cd2df5
Always defer modifier-initiated key override events
JonasGessner Jan 2, 2021
32e5180
Reregister trigger by default
JonasGessner Jan 2, 2021
df93285
Update docs
JonasGessner Jan 2, 2021
b3e956b
Handle missing key override activation options
JonasGessner Jan 2, 2021
1fa1929
Update docs
JonasGessner Jan 2, 2021
e4042db
Add missing parentheses
JonasGessner Jan 2, 2021
5da02a0
Add KEY_OVERRIDE_REPEAT_DELAY macro, update docs
JonasGessner Jan 3, 2021
3d4b352
Update docs
JonasGessner Jan 3, 2021
6ff7ff9
Fix handling of custom keycodes
JonasGessner Jan 5, 2021
a9a4e88
Make key overrides work with oneshot mods and locked oneshot mods
JonasGessner Jan 6, 2021
c520154
Add option to use weak mods in key overrides, fix when NO_ACTION_ONES…
JonasGessner Jan 9, 2021
c120ed2
Put all key overrides code behing #ifdefs to keep code size unaffected
JonasGessner Jan 9, 2021
d4cc69a
Make API more consistent, update documentation
JonasGessner Jan 11, 2021
2217e64
Remove redundant send_keyboard_report, inline single-use function
JonasGessner Jan 17, 2021
2b6c363
Fix docs
JonasGessner Jan 20, 2021
48cc460
Add extra debug message
JonasGessner Feb 27, 2021
5e22246
Add small delay before registering non-basic replacement keycodes
JonasGessner Feb 28, 2021
62ff1d9
Remove ko_option_exclusive_key_on_activate because it was working unr…
JonasGessner Mar 5, 2021
e4bafe8
Don't link to beta docs site
JonasGessner Apr 10, 2021
233e406
Reorganize key overrides docs
JonasGessner Apr 10, 2021
71a3b1c
Move key override keycodes
JonasGessner Apr 25, 2021
b105158
Move key override files into process_keycode directory
JonasGessner May 22, 2021
0466114
Move private key override function defs to dedidcated header
JonasGessner May 22, 2021
5a1b857
Add KEY_OVERRIDE_ENABLE to show_options.mk
JonasGessner May 22, 2021
5bfeec6
Add key override reference in understanding_qmk.md
JonasGessner May 22, 2021
7923293
Make ko_make_basic docs clearer, update docstrings
JonasGessner May 29, 2021
7ec29e7
Typo
JonasGessner Jun 3, 2021
03519df
Typo
JonasGessner Jun 3, 2021
385bbc8
Run formatter
JonasGessner Jul 3, 2021
52f3b7b
Remove keyboard import from process_key_override.c
JonasGessner Jul 12, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions common_features.mk
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,11 @@ ifeq ($(strip $(PRINTING_ENABLE)), yes)
SRC += $(TMK_DIR)/protocol/serial_uart.c
endif

ifeq ($(strip $(KEY_OVERRIDE_ENABLE)), yes)
drashna marked this conversation as resolved.
Show resolved Hide resolved
OPT_DEFS += -DKEY_OVERRIDE_ENABLE
SRC += $(QUANTUM_DIR)/process_keycode/process_key_override.c
endif

ifeq ($(strip $(SERIAL_LINK_ENABLE)), yes)
SERIAL_SRC := $(wildcard $(SERIAL_PATH)/protocol/*.c)
SERIAL_SRC += $(wildcard $(SERIAL_PATH)/system/*.c)
Expand Down
1 change: 1 addition & 0 deletions docs/_summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
* [Combos](feature_combo.md)
* [Debounce API](feature_debounce_type.md)
* [Key Lock](feature_key_lock.md)
* [Key Overrides](feature_key_overrides.md)
* [Layers](feature_layers.md)
* [One Shot Keys](one_shot_keys.md)
* [Pointing Device](feature_pointing_device.md)
Expand Down
4 changes: 4 additions & 0 deletions docs/config_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ If you define these options you will enable the associated feature, which may in
* Sets the delay between `register_code` and `unregister_code`, if you're having issues with it registering properly (common on VUSB boards). The value is in milliseconds.
* `#define TAP_HOLD_CAPS_DELAY 80`
* Sets the delay for Tap Hold keys (`LT`, `MT`) when using `KC_CAPSLOCK` keycode, as this has some special handling on MacOS. The value is in milliseconds, and defaults to 80 ms if not defined. For macOS, you may want to set this to 200 or higher.
* `#define KEY_OVERRIDE_REPEAT_DELAY 500`
* Sets the key repeat interval for [key overrides](feature_key_overrides.md).

## RGB Light Configuration

Expand Down Expand Up @@ -375,6 +377,8 @@ Use these to enable or disable building certain features. The more you have enab
* USB N-Key Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
* `AUDIO_ENABLE`
* Enable the audio subsystem.
* `KEY_OVERRIDE_ENABLE`
* Enable the key override feature
* `RGBLIGHT_ENABLE`
* Enable keyboard underlight functionality
* `LEADER_ENABLE`
Expand Down
229 changes: 229 additions & 0 deletions docs/feature_key_overrides.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/syllabus.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ These topics start to dig into some of the features that QMK supports. You don't
* [Tap Dance](feature_tap_dance.md)
* [Combos](feature_combo.md)
* [Userspace](feature_userspace.md)
* [Key Overrides](feature_key_overrides.md)

# Advanced Topics

Expand Down
1 change: 1 addition & 0 deletions docs/understanding_qmk.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ The `process_record()` function itself is deceptively simple, but hidden within
* [`bool process_audio(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_audio.c#L19)
* [`bool process_steno(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_steno.c#L160)
* [`bool process_music(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_music.c#L114)
* [`bool process_key_override(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/5a1b857dea45a17698f6baa7dd1b7a7ea907fb0a/quantum/process_keycode/process_key_override.c#L397)
* [`bool process_tap_dance(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_tap_dance.c#L141)
* [`bool process_unicode_common(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_unicode_common.c#L169)
calls one of:
Expand Down
Loading