!on your computer? Use a key override to make your keyboard type something different when you press
1. The general behavior is like this: If
key xare pressed, replace these keys with
key zin the keyboard report.
brightness up/downwhen pressing
KEY_OVERRIDE_ENABLE = yesto your
keymap.cfile, you'll need to define the array
key_overrides, which defines all key overrides to be used. Each override is a value of type
key_override_t. The array
NULL-terminated and contains pointers to
const key_override_t **).
key_override_tstruct has many options that allow you to precisely tune your overrides. The full reference is shown below. Instead of manually creating a
key_override_tvalue, it is recommended to use these dedicated initializers:
ko_make_basic(modifiers, key, replacement)
key_override_t, which sends
replacement(can be a key-modifer combination), when
modifiersare all pressed down. This override still activates if any additional modifiers not specified in
modifiersare also pressed down. See
ko_make_with_layers_and_negmodsto customize this behavior.
ko_make_with_layers(modifiers, key, replacement, layers)
layersthat defines on which layers the override is used.
ko_make_with_layers_and_negmods(modifiers, key, replacement, layers, negative_mods)
negative_modsthat defines which modifiers may not be pressed for this override to activate.
ko_make_with_layers_negmods_and_options(modifiers, key, replacement, layers, negative_mods, options)
optionsthat specifies additional options. See
ko_option_tfor available options.
key_override_t, which allows you to customize even more behavior. Read further below for details and examples.
backspaceare pressed is realized:
play/pausein the keymap.
`you may change it to an arbitrary other modifier, for example
rAlt(right GUI and right alt) to access a momentary layer like an fn layer. With this you completely eliminate the need to use a dedicated layer key. Of course the choice of modifier keys can be changed as needed,
rAltis just an example here.
ko_makeinitializers. For this, directly create a
key_override_tvalue and set all members. Below is a reference for all members of
key_override_tcomes into play. Understanding this is essential to be able to take full advantage of all the options offered by key overrides.
trigger), the override is 'activated' and the replacement key is registered in the keyboard report (
replacement), while the
triggerkey is removed from the keyboard report. The trigger modifiers may also be removed from the keyboard report upon activation of an override (
suppressed_mods). The override will not activate if any of the
optionmember to customize which of these events are allowed to activate your overrides (default: all three).
triggerkey is the last non-modifier key that was pressed down. This emulates the behavior of how standard OSes (macOS, Windows, Linux) handle normal key input (to understand: Hold down
a, then also hold down
b, then hold down
Bwill be typed but not
trigger) is lifted, another non-modifier key is pressed down, or one of the
negative_modifiersis pressed down. When an override deactivates, the
replacementkey is removed from the keyboard report, while the
suppressed_modsthat are still held down are re-added to the keyboard report. By default, the
triggerkey is re-added to the keyboard report if it is still held down and no other non-modifier key has been pressed since. This again emulates the behavior of how standard OSes handle normal key input (To understand: hold down
a, then also hold down
b, then also
shift, then release
Awill not be typed even though you are holding the
shiftkeys). Use the
ko_option_no_reregister_triggerto prevent re-registering the trigger key in all cases.
a, followed by
shift, you will see the letter
ais first typed, then for a short moment nothing is typed and then repeating
As are typed. Take note that, although shift is pressed down just after
ais pressed, it takes a moment until
Ais typed. This is caused by the aforementioned key repeat delay, and it is a feature that prevents unwanted repeated characters from being typed.
shift, then press
a, the letter
Ais typed. Now if you release
shiftfirst, followed by
ashortly after, you will not see the letter
abeing typed, even though for a short moment of time you were just holding down the key
a. This is because no modified characters are typed until the key repeat delay has passed.
ais pressed and held, followed by
shift, you will not immediately see the letter
bbeing typed. Instead, this event is deferred for a short moment, until the key repeat delay has passed, measured from the moment when the trigger key (
a) was pressed down.
KEY_OVERRIDE_REPEAT_DELAYmacro. Define this value in your
config.hfile to change it. It is 500ms by default.
z): They take combinations of multiple modifiers and one non-modifier key to then perform some custom action. Key overrides are implemented with much care to behave just like normal keyboard shortcuts would in regards to the order of pressed keys, timing, and interacton with other pressed keys. There are a number of optional settings that can be used to really fine-tune the behavior of each key override as well. Using key overrides also does not delay key input for regular key presses, which inherently happens in combos and may be undesirable.