aboutsummaryrefslogtreecommitdiff
path: root/termkey_keyname2sym.3
diff options
context:
space:
mode:
authorPaul LeoNerd Evans <leonerd@leonerd.org.uk>2008-12-02 00:56:43 +0000
committerPaul LeoNerd Evans <leonerd@leonerd.org.uk>2008-12-02 00:56:43 +0000
commit2fba93b6904e22e46de66648d5c98af7512e1e1e (patch)
tree074c1f9f991127acbdad7724d3eccfe45d055ab8 /termkey_keyname2sym.3
parentf75bdf1516b031b0f975b77f289ea408e30cb9c9 (diff)
downloadtermo-2fba93b6904e22e46de66648d5c98af7512e1e1e.tar.gz
termo-2fba93b6904e22e46de66648d5c98af7512e1e1e.tar.xz
termo-2fba93b6904e22e46de66648d5c98af7512e1e1e.zip
Added termkey_keyname2sym() to API
Diffstat (limited to 'termkey_keyname2sym.3')
-rw-r--r--termkey_keyname2sym.321
1 files changed, 21 insertions, 0 deletions
diff --git a/termkey_keyname2sym.3 b/termkey_keyname2sym.3
new file mode 100644
index 0000000..aba22f4
--- /dev/null
+++ b/termkey_keyname2sym.3
@@ -0,0 +1,21 @@
+.TH TERMKEY_KEYNAME2SYM 3
+.SH NAME
+termkey_keyname2sym \- look up a symbolic key value for a string name
+.SH SYNOPSIS
+.nf
+.B #include <termkey.h>
+.sp
+.BI "termkey_keysym termkey_keyname2sym(termkey_t *" tk ", const char *" keyname );
+.fi
+.sp
+Link with \fI-ltermkey\fP.
+.SH DESCRIPTION
+\fBtermkey_keyname2sym\fP looks up the symbolic key value represented by the given string name. This is a case-sensitive comparison. If the given name is not found, \fBTERMKEY_SYM_UNKNOWN\fP is returned instead. This function is the inverse of \fBtermkey_get_keyname\fP(3).
+.PP
+Because the key names are stored in an array indexed by the symbol number, this function has to perform a linear search of the names. Use of this function should be restricted to converting key names into symbolic values during a program's initialisation, so that efficient comparisons can be done while it is running.
+.SH "RETURN VALUE"
+\fBtermkey_get_key\fP() returns a pointer to a string.
+.SH "SEE ALSO"
+.BR termkey_new (3),
+.BR termkey_get_keyname (3),
+.BR termkey_snprint_key (3)