summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2022-01-03 07:43:56 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2022-01-03 07:43:56 +0200
commite3d8f675f76e86738b25a344b1c087f64bbc8ac3 (patch)
tree6921cb345f75835fc5f4a33a5e602d83a82768d8
parent0d1bc0e469e8ca4b2cd3d269974c964e0f2916b0 (diff)
Android: Default return key behavior is to insert a newline
-rw-r--r--src/app.c6
-rw-r--r--src/defs.h7
2 files changed, 12 insertions, 1 deletions
diff --git a/src/app.c b/src/app.c
index 1e66c6cf..7497d6f8 100644
--- a/src/app.c
+++ b/src/app.c
@@ -404,6 +404,12 @@ static void loadPrefs_App_(iApp *d) {
404 insert_StringSet(d->prefs.disabledFontPacks, 404 insert_StringSet(d->prefs.disabledFontPacks,
405 collect_String(suffix_Command(cmd, "id"))); 405 collect_String(suffix_Command(cmd, "id")));
406 } 406 }
407#if defined (iPlatformAndroidMobile)
408 else if (equal_Command(cmd, "returnkey.set")) {
409 /* Hardcoded to avoid accidental presses of the virtual Return key. */
410 d->prefs.returnKey = default_ReturnKeyBehavior;
411 }
412#endif
407#if !defined (LAGRANGE_ENABLE_DOWNLOAD_EDIT) 413#if !defined (LAGRANGE_ENABLE_DOWNLOAD_EDIT)
408 else if (equal_Command(cmd, "downloads")) { 414 else if (equal_Command(cmd, "downloads")) {
409 continue; /* can't change downloads directory */ 415 continue; /* can't change downloads directory */
diff --git a/src/defs.h b/src/defs.h
index 25c0ceeb..d2e13294 100644
--- a/src/defs.h
+++ b/src/defs.h
@@ -86,7 +86,7 @@ enum iToolbarAction {
86/* Return key behavior is not handled via normal bindings because only certain combinations 86/* Return key behavior is not handled via normal bindings because only certain combinations
87 are valid. */ 87 are valid. */
88enum iReturnKeyBehavior { 88enum iReturnKeyBehavior {
89 default_ReturnKeyBehavior = 89 acceptWithoutMod_ReturnKeyBehavior =
90 shiftReturn_ReturnKeyFlag | (return_ReturnKeyFlag << accept_ReturnKeyFlag), 90 shiftReturn_ReturnKeyFlag | (return_ReturnKeyFlag << accept_ReturnKeyFlag),
91 acceptWithShift_ReturnKeyBehavior = 91 acceptWithShift_ReturnKeyBehavior =
92 return_ReturnKeyFlag | (shiftReturn_ReturnKeyFlag << accept_ReturnKeyFlag), 92 return_ReturnKeyFlag | (shiftReturn_ReturnKeyFlag << accept_ReturnKeyFlag),
@@ -96,6 +96,11 @@ enum iReturnKeyBehavior {
96#else 96#else
97 return_ReturnKeyFlag | (controlReturn_ReturnKeyFlag << accept_ReturnKeyFlag), 97 return_ReturnKeyFlag | (controlReturn_ReturnKeyFlag << accept_ReturnKeyFlag),
98#endif 98#endif
99#if defined (iPlatformAndroidMobile)
100 default_ReturnKeyBehavior = acceptWithShift_ReturnKeyBehavior,
101#else
102 default_ReturnKeyBehavior = acceptWithoutMod_ReturnKeyBehavior,
103#endif
99}; 104};
100 105
101int keyMod_ReturnKeyFlag (int flag); 106int keyMod_ReturnKeyFlag (int flag);