aboutsummaryrefslogtreecommitdiff
path: root/src/binds.c
diff options
context:
space:
mode:
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);