KetraTerm
API · DevelopmentAll versions

Companion

object Companion

Helper methods for constructing and decoding packed input mode snapshots.

Functions

Link copied to clipboard
fun backarrowSendsBackspace(bits: Long, defaultSendsBackspace: Boolean): Boolean

Resolves the unmodified legacy Backspace selection. An explicit DECBKM override takes precedence over the host's current configured default.

Link copied to clipboard

Returns the packed format-other-keys mode value from bits.

Link copied to clipboard

Whether mode 1007 permits alternate-screen wheel-to-cursor-key input. Defaults to true.

Link copied to clipboard

Returns true when application cursor keys mode is enabled in bits.

Link copied to clipboard

Returns true when application keypad mode is enabled in bits.

Link copied to clipboard

Returns whether DECBKM has explicitly overridden the input profile's initial Backspace policy in bits.

Link copied to clipboard

Returns the explicit DECBKM wire selection from bits.

Link copied to clipboard

Returns true when bracketed paste mode is enabled in bits.

Link copied to clipboard

Returns true when focus reporting mode is enabled in bits.

Link copied to clipboard

Returns true when new-line mode is enabled in bits.

Link copied to clipboard

Whether XTSHIFTESCAPE requests Shift in mouse reports. Defaults to false.

Link copied to clipboard
fun keyFormatOption(bits: Long, resource: Int): Int

Reads an XTFMTKEYS format (0 or 1), or -2 for an unsupported resource.

Link copied to clipboard
fun keyModifierOption(bits: Long, resource: Int): Int

Reads an XTMODKEYS resource from the same snapshot as all other input modes. Returns -1 for explicit disable and -2 for an unsupported resource identifier. Cursor/function resources default to 2; all other resources default to 0.

Link copied to clipboard

Returns the packed Kitty keyboard progressive-enhancement flags from bits.

Link copied to clipboard

Returns the packed modify-other-keys mode value from bits.

Link copied to clipboard

Returns the packed mouse encoding mode ordinal from bits.

Link copied to clipboard

Returns the packed mouse tracking mode ordinal from bits.

Link copied to clipboard
fun withKeyFormatOption(bits: Long, resource: Int, value: Int): Long

Returns bits with one XTFMTKEYS resource replaced, preserving all other bits. This pure primitive operation does not publish or mutate an input state.

Link copied to clipboard
fun withKeyModifierOption(bits: Long, resource: Int, value: Int): Long

Returns bits with one XTMODKEYS resource replaced, preserving all other bits. This pure primitive operation does not publish or mutate an input state. A zero word encodes defaults: 2 for cursor/function keys and 0 otherwise. Use those values to restore an individual resource to its default.