Skip to content

Capsicain Virtual Keys

Ronald Smits edited this page Feb 9, 2021 · 5 revisions

Virtual Keys

These keys are defined by Capsicain and can be used in the .ini.

Virtual keys have special effects. They are not sent out, Windows does not understand these keys.

Virtual Modifiers

MOD9 .. MOD15

Virtual modifiers are very useful because, unlike the real modifiers, they are never sent to Windows. This makes it much easier to define key combos that do not have side effects.

The standard way to use virtual modifiers is

REWIRE (keyA) MOD9
COMBO (keyB) [...& .... ....] > key(C)

Now pressing keyB while keyA is down will trigger a "C down C up".

If you did the same config with LCTRL instead of MOD9, then 'tap C' would still happen, BUT Windows would know that the LCTRL key is down, so the end result is "Ctrl + C", which is probably not what you wanted.

Pressing, tapping, or holding keyA alone has no effect, since MOD9 is managed by Capsicain only and there is no corresponding rule for "MOD9 without another key".

Simple virtual keys

These are single keys that tell Capsicain to do something.

Use them like COMBO A [&.] > key ( CAPSON ) : Ctrl+A turns on Capslock

CAPSON : turns on CapsLock, regardless of its current state

CAPSOFF : turns off CapsLock

Note: you can toggle CapsLock the normal way with key ( CAPS )

Complex Virtual keys

SLEEP

Sleep n milliseconds before sending the next key.

Maximum 30.000 (30 seconds)

Can only be used with Function: sequence().

Use it like

COMBO (something) > sequence(s_l_o_SLEEP:1000_w)

Note: sleeping was done up to version 69 with virtual key PAUSE, which interpreted the :value as 1/10th seconds.
This was a hack since the value was limited to 255 back then.

CONFIGSWITCH

Switch to the given configuration (by number), when used with Function: sequence().

Use it like

COMBO (something) > sequence(CONFIGSWITCH:2_SCRLOCK)

Internal Use only

These virtual keys should not be used in .ini files.

They are used by Capsicain internally, to trigger certain events.

  • DEADKEY : the next key will be used to set the modifierState.activeDeadkey
  • TEMPRELEASEKEYS : break all keys that have been sent, and remember them
  • TEMPRESTOREKEYS : make all keys that have been down before TEMPRELEASEKEYS
  • CONFIGPREVIOUS: switch back to the previously used config