ansi/keys
src/ansi/keys.tur
normalized key-name strings, byte parsing, and inverse mapping.
defn
parse-key-bytes
(parse-key-bytes [bytes :cstr len :int])
decode a byte buffer into a normalized key name.
Parameters
| bytes | pointer to raw bytes (terminal input) | |
| len | number of bytes |
Returns
A malloc'd cstr key name. Unknown sequences are returned as "<raw:HH...>" hex so all input is printable.
Since: tur-ansi AN2
defn
key-name->bytes
(key-name->bytes [name :cstr])
inverse of parse-key-bytes.
defn
key-ctrl?
(key-ctrl? [k :cstr])
1 when the key name carries a C- modifier prefix.
defn
key-shift?
(key-shift? [k :cstr])
1 when the key name carries an S- modifier prefix.
defn
key-alt?
(key-alt? [k :cstr])
1 when the key name carries an M- (Meta/Alt) modifier prefix.
Internal definitions
key-- 1 when two normalized key names are equal, 0 otherwise.