git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@233 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
NishiOwO
2025-10-08 18:42:01 +00:00
parent 9d2b51402d
commit 662f5796c5
5 changed files with 60 additions and 8 deletions

View File

@@ -182,9 +182,12 @@ void MwLLNextEvent(MwLL handle) {
MwLLDispatch(handle, move, &p);
} else if(ev.type == KeyPress) {
int n;
int n = -1;
KeySym sym = XLookupKeysym(&ev.xkey, 0);
char* str = XKeysymToString(sym);
if(strcmp(str, "space") == 0) str = " ";
/* HACK: this is bad, you can guess why */
if(strlen(str) == 1) {
char s = str == NULL ? 0 : str[0];
@@ -194,9 +197,11 @@ void MwLLNextEvent(MwLL handle) {
} else {
n = s;
}
MwLLDispatch(handle, key, &n);
} else if(strcmp(str, "BackSpace") == 0) {
n = MwLLKeyBackSpace;
}
if(n != -1) MwLLDispatch(handle, key, &n);
}
if(render) {
int x, y;