diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2022-01-03 07:43:56 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2022-01-03 07:43:56 +0200 |
commit | e3d8f675f76e86738b25a344b1c087f64bbc8ac3 (patch) | |
tree | 6921cb345f75835fc5f4a33a5e602d83a82768d8 /src | |
parent | 0d1bc0e469e8ca4b2cd3d269974c964e0f2916b0 (diff) |
Android: Default return key behavior is to insert a newline
Diffstat (limited to 'src')
-rw-r--r-- | src/app.c | 6 | ||||
-rw-r--r-- | src/defs.h | 7 |
2 files changed, 12 insertions, 1 deletions
@@ -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 */ |
@@ -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. */ |
88 | enum iReturnKeyBehavior { | 88 | enum 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 | ||
101 | int keyMod_ReturnKeyFlag (int flag); | 106 | int keyMod_ReturnKeyFlag (int flag); |