Skip to content
cajhin edited this page Jul 26, 2023 · 5 revisions

OPTION keyword

OPTIONs are used inside configs. Each config must define its own options.

OPTION configName {any string}

Defines the name of the config. This is for convenience only, so you don't have to remember the config numbers.

This string is shown on config change, and with the Status command.

OPTION debug

Turns on debug output for this config.

Notes

  • updating the console with new text takes much longer than the actual key processing; but you will not notice it, it is in the 1-2 millisecond range.
  • the default changed to "no logging" for security reason. You must be aware that
    everything you type (passwords...) is visible in the console window when debug is on.
  • debugging is only shown in the console. Nothing is ever written to disk.

OPTION flipYZ

Flips the Y and Z key for this config.
Only useful for people with German keyboards (basically changes the alpha keys from QWERTY to QWERTZ).

This option can be toggled with [ESC]+[Z] anytime.
(Note this is the real [Z], labeled "Y" on German keyboards).

This option will also switch Ctrl-Z and Ctrl-Y.
Depending on your preferences, it may be better to configure this with an ALPHA_FROM keyword instead.

OPTION LcontrolLwinBlocksAlphaMapping

Character keys are never remapped with ALPHA_FROM... when [LControl] or [LWin] is down.

This is useful when you want to change alpha keys, but not the Windows shortcuts.

For example, I don't want Ctrl+S and Ctrl+C to move around with a Dvorak layout. Hitting Ctrl+C is 100% muscle memory for me.

OPTION flipAltWinOnAppleKeyboards

Flips the "Applekey" and "Alt" on keyboards with an "Apple vendor code".

This option has no effect on PC keyboards.

Only useful for people who use Apple keyboards on PC.

This option can be toggled with [ESC]+[W]

OPTION processOnlyFirstKeyboard

If there is more than one keyboard (e.g. laptop with USB keyboard attached), then Capsicain will process only the board that sends the first key stroke after each config change.

This is useful to have a "debugging" board with standard behavior, or a guest board at your workplace.

OPTION IncludeDeviceID {searchString}

This layer is only active, if the current device ID contains the searchString.

Example

The device id is shown with the [ESC]+S status command.

My HP laptop keyboard contains ven_hpq:
keyboard device id: acpi\ven_hpq&dev_8002

My bluetooth keyboard:
keyboard device id: hid\{00001124-0000-1000-8000-00805f9b34fb}_vid&00020a5c_pid&8502&col01

capsicain.ini example:

[LAYER_2]
#Layer 2 flips Y and Z only on the HP keyboard
OPTION IncludeDeviceID ven_hpq  
REWIRE Y Z

OPTION ExcludeDeviceID {searchString}

The opposite of IncludeDeviceID; the layer is only active if the device ID does NOT contain the searchString.

capsicain.ini example:

[LAYER_2]
#Layer 2 flips Y and Z on all boards except HP keyboards
OPTION ExcludeDeviceID ven_hpq  
REWIRE Y Z

OPTION DelayForKeySequenceMS {milliseconds}

When sending key sequences, sleep {milliseconds} between each keystroke.

Default is 5 ms.

Your system may drop keys when they are sent too fast. Doesn't happen on my machines, except on remote desktops and some Linux VMs.

This value can be changed anytime with [ESC] + [,] and [.] keys

NOTES

  • For RDP sessions, you want to set 'Options > Local Resources > Apply Windows Key combinations: On this machine'.
    Otherwise you need 10+ ms delay for reliable key sequences, depending on the network.
  • The Windows Sleep function is not precise; DelayForKeySequenceMS 1 may actually sleep 1 or 20ms depending on thread scheduling. The difference between 0 and 1ms can be quite noticeable.
  • This has no impact on normal typing, only on the > sequence(...) function.
  • capsicain runs with high priority. When you send a very long sequence, other processes may not be able to interrupt capsicain to process the key events, unless you sleep at least for 1ms.

Obsolete Options

ShiftShiftToShiftLock

This was a hardcoded option to define "LShift + RShift = CapsLock ON" and "RShift + LShift = CapsLock OFF".

This is now configurable with:

COMBO  LSHF [& ....] > key(CAPSOFF)
COMBO  RSHF [.&] > key(CAPSON)

AltAltToAlt

This was a hardcoded option to define "Both ALT = LALT", so I could use the nice ALT keys for other things.

Pressing both Alt keys turned out to be a very inconvenient action. I now do it with "Tap and Hold LALT = LALT" :

REWIRE LALT MOD12 // LALT