aboutsummaryrefslogtreecommitdiff
path: root/termkey.c
diff options
context:
space:
mode:
authorPaul LeoNerd Evans <leonerd@leonerd.org.uk>2011-04-01 10:48:15 +0100
committerPaul LeoNerd Evans <leonerd@leonerd.org.uk>2011-04-01 10:48:15 +0100
commita3b88040185e7bc927056475bfcc91b955d8dba5 (patch)
treeeea956114cd4991585e4e06a71bba20faf199727 /termkey.c
parent59800c356b7737213d80bec5d0b3f0df4b69284c (diff)
downloadtermo-a3b88040185e7bc927056475bfcc91b955d8dba5.tar.gz
termo-a3b88040185e7bc927056475bfcc91b955d8dba5.tar.xz
termo-a3b88040185e7bc927056475bfcc91b955d8dba5.zip
Ensure strpkey can parse numbered function keys
Diffstat (limited to 'termkey.c')
-rw-r--r--termkey.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/termkey.c b/termkey.c
index 0900203..302d81f 100644
--- a/termkey.c
+++ b/termkey.c
@@ -1122,7 +1122,10 @@ TermKeyResult termkey_strpkey(TermKey *tk, const char *str, TermKeyKey *key, Ter
else if((key->code.sym = termkey_keyname2sym(tk, str)) != TERMKEY_SYM_UNKNOWN) {
key->type = TERMKEY_TYPE_KEYSYM;
}
- // TODO: Consider function keys
+ else if(sscanf(str, "F%d", &key->code.number) == 1) {
+ key->type = TERMKEY_TYPE_FUNCTION;
+ }
+ // TODO: Consider mouse events?
else {
return TERMKEY_RES_NONE;
}