Documentation
¶
Index ¶
Constants ¶
const LeftShiftCode = 42
LeftShiftCode is the key held to type a shift-modified character.
Variables ¶
var KeyboardMap = map[string]int{}/* 151 elements not displayed */
var LegacyKeyboardMap map[int]string
Functions ¶
func ExpandShift ¶ added in v2.18.0
ExpandShift turns a list of map codes into the physical keys to press. Shift-modified (negative) codes become their base code, with LeftShift inserted before the first of them unless a Shift already precedes it. A code that appears more than once is kept only at its first position.
func GetLegacyKey ¶
func IsShiftedKey ¶ added in v2.15.0
IsShiftedKey reports whether name maps to a shift-modified key (negative code). If so, it returns the positive base keycode that must be pressed while LeftShift is held. Returns 0, false for unshifted keys, braced specials that are not shift-modified, and unknown names.
func ParseKeyCombo ¶ added in v2.18.0
ParseKeyCombo parses a keyboard key argument string and returns the corresponding key codes. It supports both single keys (e.g., "a", "{f9}") and combo keys with the "+" delimiter (e.g., "{ctrl+q}", "{shift+a}").
The function returns:
- codes: slice of keyboard codes
- isCombo: true if multiple keys detected, false for a single key
- error: if any key name is unknown
Examples:
- ParseKeyCombo("a") -> [30], false, nil
- ParseKeyCombo("{f9}") -> [67], false, nil
- ParseKeyCombo("{ctrl+q}") -> [29, 16], true, nil
- ParseKeyCombo("{shift+a}") -> [42, 30], true, nil
func SetupLegacyKeyboardMap ¶
func SetupLegacyKeyboardMap()
func ToKeyboardCode ¶ added in v2.18.0
ToKeyboardCode converts a single ZapScript key symbol to a keyboard code.
Types ¶
This section is empty.