aboutsummaryrefslogtreecommitdiff
path: root/src/binds.c
diff options
context:
space:
mode:
authorHarry Jeffery <harry@exec64.co.uk>2017-11-28 21:56:34 +0000
committerHarry Jeffery <harry@exec64.co.uk>2017-11-28 21:59:16 +0000
commit11e52cb5d877520de730f56d9725c93fcc7bf3c5 (patch)
tree31dc3295fd1a8a371c11beb58303902d62f1f149 /src/binds.c
parent86b7b1bf49605f2d301e4a81658a39c0e8b40caa (diff)
downloadimv-11e52cb5d877520de730f56d9725c93fcc7bf3c5.tar.gz
Tweak config option names & capitalisation
Diffstat (limited to 'src/binds.c')
-rw-r--r--src/binds.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/binds.c b/src/binds.c
index e0426e6..384d6ee 100644
--- a/src/binds.c
+++ b/src/binds.c
@@ -188,6 +188,7 @@ static int print_event(char *buf, size_t len, const SDL_Event *event)
/* Try plain old character input */
const char *keyname = SDL_GetKeyName(kevent->keysym.sym);
+ char singlekey[2] = {0};
/* Because '<' and '>' have special meaning in our syntax, and '=', '[', and
* ']' are restricted within ini files, we rename these. */
@@ -201,6 +202,9 @@ static int print_event(char *buf, size_t len, const SDL_Event *event)
keyname = "LeftSquareBracket";
} else if(!strcmp(keyname, "]")) {
keyname = "RightSquareBracket";
+ } else if(isalpha(*keyname)) {
+ singlekey[0] = tolower(*keyname);
+ keyname = &singlekey[0];
}
return snprintf(buf, len, "%s%s", prefix, keyname);