TerminalModifiers

Bit mask vocabulary for UI keyboard modifiers accepted by terminal input.

These are internal encoder bits, not CSI modifier parameter values. CSI encoding applies the 1 + modifiers translation only at the wire boundary.

Properties

Link copied to clipboard
const val ALT: Int

Alt is active.

Link copied to clipboard
const val CAPS_LOCK: Int

Caps Lock is enabled.

Link copied to clipboard
const val CTRL: Int

Control is active.

Link copied to clipboard
const val HYPER: Int

Hyper is active.

Link copied to clipboard
const val META: Int

Meta is active.

Link copied to clipboard
const val NONE: Int = 0

No keyboard modifiers are active.

Link copied to clipboard
const val NUM_LOCK: Int

Num Lock is enabled.

Link copied to clipboard
const val SHIFT: Int

Shift is active.

Link copied to clipboard
const val SUPER: Int

Super is active, such as Windows or Command.

Link copied to clipboard
const val VALID_MASK: Int

Mask containing every supported modifier bit.

Functions

Link copied to clipboard
fun hasAlt(modifiers: Int): Boolean

Returns true when Alt is present in modifiers.

Link copied to clipboard
fun hasCapsLock(modifiers: Int): Boolean

Returns true when Caps Lock is present in modifiers.

Link copied to clipboard
fun hasCtrl(modifiers: Int): Boolean

Returns true when Control is present in modifiers.

Link copied to clipboard
fun hasHyper(modifiers: Int): Boolean

Returns true when Hyper is present in modifiers.

Link copied to clipboard
fun hasMeta(modifiers: Int): Boolean

Returns true when Meta is present in modifiers.

Link copied to clipboard
fun hasNumLock(modifiers: Int): Boolean

Returns true when Num Lock is present in modifiers.

Link copied to clipboard
fun hasShift(modifiers: Int): Boolean

Returns true when Shift is present in modifiers.

Link copied to clipboard
fun hasSuper(modifiers: Int): Boolean

Returns true when Super is present in modifiers.

Link copied to clipboard
fun isValid(modifiers: Int): Boolean

Returns true when modifiers contains only supported modifier bits.

Link copied to clipboard
fun toCsiModifierParam(modifiers: Int): Int

Converts internal modifier bits to an xterm-style CSI modifier parameter.

Link copied to clipboard

Converts internal modifier bits to Kitty's CSI-u modifier parameter.