The [behavior] section contains configuration for how different keyboard actions should behave:
In the tap_hold sub-table, you can configure the following parameters:
enable_hrm: Enables or disables HRM (Home Row Mod) mode. When enabled, the prior_idle_time setting becomes functional. Defaults to false.permissive_hold: Enables permissive hold mode. When enabled, hold action will be triggered when a key is pressed and released during tap-hold decision. This option is recommended to set to true when enable_hrm is set to true.chordal_hold: (Experimental) Enables chordal hold mode. When enabled, hold action will be triggered when a key from "opposite" hand is pressed. In current experimental version, the "opposite" hand is calculated according to the number of cols/rows. This option is recommended to set to true when enable_hrm is set to true.hold_on_other_press: Enables hold-on-other-key-press mode. When enabled, hold action will be triggered immediately when any other non-tap-hold key is pressed while a tap-hold key is being held. This provides faster modifier activation without waiting for the timeout. Priority rules: When HRM is disabled, permissive hold takes precedence over this feature. When HRM is enabled, this feature works normally. Defaults to false.prior_idle_time: If the previous non-modifier key is released within this period before pressing the current tap-hold key, the tap action for the tap-hold behavior will be triggered. This parameter is effective only when enable_hrm is set to true. Defaults to 120ms.hold_timeout: Defines the duration a tap-hold key must be pressed to determine hold behavior. If tap-hold key is released within this time, the key is recognized as a "tap". Holding it beyond this duration triggers the "hold" action. Defaults to 250ms.post_wait_time: Adds an additional delay after releasing a tap-hold key to check if any keys pressed during the hold_timeout are released. This helps accommodate fast typing scenarios where some keys may not be fully released during a hold. Defaults to 50msThe following are the typical configurations:
Tri Layer works by enabling a layer (called adjust) when other two layers (upper and lower) are both enabled.
You can enable Tri Layer by specifying the upper, lower and adjust layers in the tri_layer sub-table:
In this example, when both layers 1 (upper) and 2 (lower) are active, layer 3 (adjust) will also be enabled.
Note that "#layer_name" could also be used in place of layer numbers.
In the one_shot sub-table you can define how long OSM or OSL will wait before releasing the modifier/layer with the timeout option, default is one second. timeout is a string with a suffix of either "s" or "ms".
In the combo sub-table, you can configure the keyboard's combo key functionality. Combo allows you to define a group of keys that, when pressed simultaneously, will trigger a specific output action.
Combo configuration includes the following parameters:
timeout: Defines the maximum time window for pressing all combo keys. If the time exceeds this, the combo key will not be triggered. The format is a string, which can be milliseconds (e.g. "200ms") or seconds (e.g. "1s").combos: An array containing all defined combos. Each combo configuration is an object containing the following attributes:
actions: An array of strings defining the keys that need to be pressed simultaneously to trigger the combo action.output: A string defining the output action to be triggered when all keys in actions are pressed simultaneously.layer: An optional parameter, a number, specifying which layer the combo is valid on. If not specified, the combo is valid on all layers.Here is an example of combo configuration:
In the tap_dance sub-table, you can configure the keyboard's tap dance functionality. Tap dance allows you to define different actions based on the number of times a key is tapped within a specific time window.
The basic tap dance(with 2 taps) works as follows:
tap action is triggered.hold action is triggered.hold_after_tap action is triggered.double_tap action is triggered.In RMK, tap dance behavior also supports multiple taps and hold-after-multiple-taps:
tap_actions array, for example, tapping 5 times will trigger tap_action[4].hold_actions array is triggered, for example, hold the key after tapping 5 times will trigger hold_action[4].Tap dance configuration includes the following parameters:
tap_dances: An array containing all defined tap dances. Each tap dance configuration is an object containing the following attributes:
tap: The action to be triggered on the first tap. This is the default action when the key is tapped once.hold: The action to be triggered when the key is held down (not tapped).hold_after_tap: The action to be triggered when the key is held down after being tapped once.double_tap: The action to be triggered when the key is tapped twice within the tapping term.tapping_term: The time window (in milliseconds or seconds) within which taps are considered part of the same tap dance sequence. Defaults to 200ms if not specified.tap_actions: An array of actions, each corresponding to the number of taps. For example, tap_actions = ["F1", "F2", "F3"] means a single tap triggers "F1", double tap triggers "F2", triple tap triggers "F3", and so on. If the tap count exceeds the length of the array, the last action is used.hold_actions: An array of actions, each corresponding to holding the key after a certain number of taps. For example, hold_actions = ["MO(1)", "MO(2)", "MO(3)"] means holding after one tap triggers "MO(1)", holding after two taps triggers "MO(2)", and so on. If the tap count exceeds the length of the array, the last action is used.tap_actions and hold_actions cannot be used together with tap, hold, hold_after_tap, or double_tap. For each tap dance configuration, please choose either the array style (tap_actions/hold_actions) or the individual fields (tap/hold/hold_after_tap/double_tap).
Here is an example of tap dance configuration:
To use a tap dance in your keymap, reference it by its index (starting from 0):
The tap dance functionality is controlled by the following configuration limits in the [rmk] section:
tap_dance_max_num: Maximum number of tap dances (default: 8)tap_dance_max_tap: Maximum number of taps per tap dance (default: 2, range: 2-256)To support more taps per sequence, increase the tap_dance_max_tap value:
Note that the default format (using tap, hold, hold_after_tap, double_tap) is limited to 2 taps, while the extended format (using tap_actions and hold_actions) can support up to the configured tap_dance_max_tap value.
In the fork sub-table, you can configure the keyboard's state based key fork functionality. Forks allows you to define a trigger key and condition dependent possible replacement keys. When the trigger key is pressed, the condition is checked by the following rule: If any of the match_any states are active AND none of the match_none states active, the trigger key will be replaced with positive_output, otherwise with the negative_output. By default the modifiers listed in match_any will be suppressed (even the one-shot modifiers) for the time the replacement key action is executed. However, with kept_modifiers some of them can be kept instead of automatic suppression.
Fork configuration includes the following parameters:
forks: An array containing all defined forks. Each fork configuration is an object containing the following attributes:
trigger: Defines the triggering key.negative_output: A string defining the output action to be triggered when the conditions are not metpositive_output: A string defining the output action to be triggered when the conditions are metmatch_any: A strings defining a combination of modifier keys, lock leds, mouse buttons (optional)match_none: A strings defining a combination of modifier keys, lock leds, mouse buttons (optional)kept_modifiers: A strings defining a combination of modifier keys, which should not be 'suppressed' form the keyboard state for the time the replacement action is executed. (optional)bindable: Enables the evaluation of not yet triggered forks on the output of this fork to further manipulate the output. Advanced use cases can be solved using this option. (optional)For match_any, match_none the legal values are listed below (many values may be combined with "|"):
LShift, LCtrl, LAlt, LGui, RShift, RCtrl, RAlt, RGui (these are including the effect of explicitly held and one-shot modifiers too)CapsLock, ScrollLock, NumLock, Compose, KanaMouseBtn1 .. MouseBtn8Here is a sample of fork configuration with random examples:
Please note that the processing of forks happen after combos and before others, so the trigger key must be the one listed in your keymap (or combo output). For example if LT(2, Backspace) is in your keymap, then trigger = "Backspace" will NOT work, you should "replace" the full key and use trigger = "LT(2, Backspace)" instead, like in the example above. You may want to include F24 or similar dummy keys in your keymap, and use them as trigger for your pre-configured forks, such as Shift/CapsLock dependent macros to enter unicode characters of your language.
Vial does not support fork configuration yet.