summaryrefslogtreecommitdiffstats
path: root/src/tk
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2021-09-25 13:14:39 (EDT)
committer P. J. McDermott <pj@pehjota.net>2021-09-25 13:14:39 (EDT)
commite131c8fe8de5d8d956a10623bb9351df0c526845 (patch)
tree9f201c72f200a2a3cff6712e4a64cae1c9a45035 /src/tk
parentf1210cea09c85c5c972d691d38b3b59f2cdbb15f (diff)
downloadmazefight-e131c8fe8de5d8d956a10623bb9351df0c526845.zip
mazefight-e131c8fe8de5d8d956a10623bb9351df0c526845.tar.gz
mazefight-e131c8fe8de5d8d956a10623bb9351df0c526845.tar.bz2
tk: Handle keypad Enter key
Diffstat (limited to 'src/tk')
-rw-r--r--src/tk/button.c1
-rw-r--r--src/tk/check.c1
-rw-r--r--src/tk/radio.c1
-rw-r--r--src/tk/text.c1
4 files changed, 4 insertions, 0 deletions
diff --git a/src/tk/button.c b/src/tk/button.c
index 90752eb..1152bd9 100644
--- a/src/tk/button.c
+++ b/src/tk/button.c
@@ -63,6 +63,7 @@ _mftk_button_key_event(struct mftk_widget *w, SDL_Event *e)
switch (e->key.keysym.sym) {
case SDLK_SPACE:
case SDLK_RETURN:
+ case SDLK_KP_ENTER:
if (b->action == NULL) {
return 0;
}
diff --git a/src/tk/check.c b/src/tk/check.c
index b26f7d7..0b2ea56 100644
--- a/src/tk/check.c
+++ b/src/tk/check.c
@@ -108,6 +108,7 @@ _mftk_check_key_event(struct mftk_widget *w, SDL_Event *e)
}
return c->action(c->user_data,c->state);
case SDLK_RETURN:
+ case SDLK_KP_ENTER:
return c->submit(c->user_data);
default:
break;
diff --git a/src/tk/radio.c b/src/tk/radio.c
index 79271ee..755be15 100644
--- a/src/tk/radio.c
+++ b/src/tk/radio.c
@@ -119,6 +119,7 @@ _mftk_radio_key_event(struct mftk_widget *w, SDL_Event *e)
}
return r->action(r->user_data,r->state);
case SDLK_RETURN:
+ case SDLK_KP_ENTER:
return r->submit(r->user_data);
default:
break;
diff --git a/src/tk/text.c b/src/tk/text.c
index f509c14..8622e63 100644
--- a/src/tk/text.c
+++ b/src/tk/text.c
@@ -127,6 +127,7 @@ _mftk_text_key_event(struct mftk_widget *w, SDL_Event *e)
}
return t->action(t->user_data, t->val);
case SDLK_RETURN:
+ case SDLK_KP_ENTER:
return t->submit(t->user_data);
default:
break;