From b8a3d1d7ea0cd34e3bacf87e06d90a5b4d73d8f3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jaakko=20Kera=CC=88nen?= jaakko.keranen@iki.fi
Date: Sun, 13 Oct 2024 12:10:05 +0300
Subject: [PATCH 1/1] Mobile: Native input widgets was leaking key events
Sometimes arrow keys would cause accidental navigation while
entering text in the native widget.
res/about/ios-version.gmi | 1 +
src/ui/inputwidget.c | 18 ++++++++++++++++--
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/res/about/ios-version.gmi b/res/about/ios-version.gmi
index bffd11f8..9e3be676 100644
--- a/res/about/ios-version.gmi
+++ b/res/about/ios-version.gmi
@@ -7,6 +7,7 @@
+* Fixed accidental navigation when editing text with the keyboard.
diff --git a/src/ui/inputwidget.c b/src/ui/inputwidget.c
index 63b7fa21..593b32dd 100644
--- a/src/ui/inputwidget.c
+++ b/src/ui/inputwidget.c
@@ -2679,7 +2679,6 @@ static iBool processEvent_InputWidget_(iInputWidget *d, const SDL_Event *ev) {
return iTrue;
}
}
-#endif
if (d->inFlags & enterKeyEnabled_InputWidgetFlag &&
(checkAcceptMods_InputWidget_(d, mods) ||
(~d->inFlags & lineBreaksEnabled_InputWidgetFlag))) {
@@ -2695,6 +2694,10 @@ static iBool processEvent_InputWidget_(iInputWidget *d, const SDL_Event *ev) {
return iTrue;
}
return iFalse;
+#else
/* Native input handles Return key. */
return iTrue;
+#endif
case SDLK_ESCAPE:
end_InputWidget(d, iTrue);
setFocus_Widget(NULL);
@@ -2865,7 +2868,18 @@ static iBool processEvent_InputWidget_(iInputWidget *d, const SDL_Event *ev) {
}
refresh_Widget(d);
return iTrue;
-#endif /* !LAGRANGE_USE_SYSTEM_TEXT_INPUT */
+#else /* !LAGRANGE_USE_SYSTEM_TEXT_INPUT */
/* The native input handles cursor movements. */
case SDLK_HOME:
case SDLK_END:
case SDLK_LEFT:
case SDLK_RIGHT:
case SDLK_UP:
case SDLK_DOWN:
case SDLK_PAGEUP:
case SDLK_PAGEDOWN:
return iTrue;
+#endif
}
if (mods & (KMOD_GUI | KMOD_CTRL)) {
return iFalse;
--
2.25.1
text/plain
This content has been proxied by September (ba2dc).