KetraTerm
API · DevelopmentAll versions

withKeyModifierOption

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.

Return

updated packed word, ready for an independent TerminalInputState to publish.

Parameters

bits

original coherent packed mode snapshot.

resource

a supported XtermKeyResource identifier; string-action resource 5 is excluded.

value

-1 for explicit disable, 0..15 for keyboard, 0..3 for ordinary keys, or 0..4 for cursor, function, keypad, modifier, and special keys.

Throws

if the resource or value is unsupported.