|
NAMEtermkey_strpkey - parse a string representing a key eventSYNOPSIS#include <termkey.h> char *termkey_strpkey(TermKey *tk, const char *str, TermKeyKey *key, TermKeyFormat format); Link with -ltermkey. DESCRIPTIONtermkey_strpkey(3) parses a string buffer containing a human-readable representation of a key event. It fills the key structure from the results of this parsing, similar to the strptime(3) standard library function.The format argument specifies the format expected in the string, as a bitmask of the following constants:
Before returning, this function canonicalises the key structure according to the rules given for termkey_canonicalise(3). The TERMKEY_FORMAT_WRAPBRACKET option is currently not supported by termkey_strpkey(). When returning a TERMKEY_TYPE_UNICODE key structure, this function will fill in the utf8 member. RETURN VALUEAfter a successful parse, termkey_strpkey() returns a pointer to the first character of the input it did not consume. If the input string contains more characters then this will point at the first character beyond. If the entire input string was consumed, then this will point at a null byte. If termkey_strpkey() fails to parse, it returns NULL. After a failed parse, the key structure may contain partial or invalid results. The structure will only be valid if the function returns a non-NULL result.SEE ALSOtermkey_new(3), termkey_strfkey(3), termkey_keycmp(3), termkey(7) Visit the GSP FreeBSD Man Page Interface. |