diff options
author | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2012-01-18 12:01:38 +0000 |
---|---|---|
committer | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2012-01-18 12:01:38 +0000 |
commit | 082b49f0f8790e2cf98346a03c53f492d9d5dcba (patch) | |
tree | 91d657db23e92b6b658dd4e73cecf1fb18c79188 /man/termkey_strpkey.3 | |
parent | d64ba87edae62894ca74cfb9d6d8cdd88c213397 (diff) | |
download | termo-082b49f0f8790e2cf98346a03c53f492d9d5dcba.tar.gz termo-082b49f0f8790e2cf98346a03c53f492d9d5dcba.tar.xz termo-082b49f0f8790e2cf98346a03c53f492d9d5dcba.zip |
Move the growing collection of manpages into their own man/ subdirectory
Diffstat (limited to 'man/termkey_strpkey.3')
-rw-r--r-- | man/termkey_strpkey.3 | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/man/termkey_strpkey.3 b/man/termkey_strpkey.3 new file mode 100644 index 0000000..f9de839 --- /dev/null +++ b/man/termkey_strpkey.3 @@ -0,0 +1,35 @@ +.TH TERMKEY_STRPKEY 3 +.SH NAME +termkey_strpkey \- parse a string representing a key event +.SH SYNOPSIS +.nf +.B #include <termkey.h> +.sp +.BI "char *termkey_strpkey(TermKey *" tk ", const char *" str ", +.BI " TermKeyKey *" key ", TermKeyFormat " format ); +.fi +.sp +Link with \fI-ltermkey\fP. +.SH DESCRIPTION +\fBtermkey_strpkey\fP(3) parses a string buffer containing a human-readable representation of a key event. It fills the \fIkey\fP structure from the results of this parsing, similar to the \fBstrptime\fP(3) standard library function. +.PP +The \fIformat\fP argument specifies the format expected in the string, as a bitmask of the following constants: +.TP +.B TERMKEY_FORMAT_LONGMOD +Expect full modifier names e.g. "Shift-" instead of abbreviating to "S-". +.TP +.B TERMKEY_FORMAT_CARETCTRL +If the only modifier is \fBTERMKEY_MOD_CTRL\fP on a plain letter, accept it as "^X" rather than "Ctrl-X". +.TP +.B TERMKEY_FORMAT_ALTISMETA +Use the name "Meta" or the letter "M" instead of "Alt" or "A". +.PP +Before returning, this function canonicalises the \fIkey\fP structure according to the rules given for \fBtermkey_canonicalise\fP(3). +.PP +The \fBTERMKEY_FORMAT_WRAPBRACKET\fP and \fBTERMKEY_FORMAT_MOUSE_POS\fP options are currently not supported by \fBtermkey_strpkey\fP(). When returning a \fBTERMKEY_TYPE_UNICODE\fP key structure, this function will fill in the \fIutf8\fP member. +.SH "RETURN VALUE" +After a successful parse, \fBtermkey_strpkey\fP() 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 \fBtermkey_strpkey\fP() fails to parse, it returns \fBNULL\fP. After a failed parse, the \fIkey\fP structure may contain partial or invalid results. The structure will only be valid if the function returns a non-\fBNULL\fP result. +.SH "SEE ALSO" +.BR termkey_new (3), +.BR termkey_strfkey (3), +.BR termkey_keycmp (3) |