OSK: Reposition if cursor overlap zone via [Enter]

Onscreen keyboard repositions itself to the top if you use [Enter]
to move the cursor down, and it begins overlapping the keyboard.

Also, play "carriage return" sound effect, even when entering
a blank 'line' of text.
This commit is contained in:
Bill Kendrick 2022-02-17 22:19:57 -08:00
parent 278513979a
commit 5c2bcd44a2
2 changed files with 21 additions and 4 deletions

View file

@ -22,7 +22,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
(See COPYING.txt)
June 14, 2002 - February 11, 2022
June 14, 2002 - February 17, 2022
*/
#include "platform.h"
@ -2894,8 +2894,13 @@ static void mainloop(void)
cursor_x = cursor_left;
cursor_y = min(cursor_y + font_height, canvas->h - font_height);
playsound(screen, 0, SND_RETURN, 1, SNDPOS_RIGHT, SNDDIST_NEAR);
/* Reposition the on-screen keyboard if we begin typing over it */
update_canvas_ex(kbd_rect.x, kbd_rect.y, kbd_rect.x + kbd_rect.w,
kbd_rect.y + kbd_rect.h, 0);
update_screen_rect(&kbd_rect);
reposition_onscreen_keyboard(cursor_y);
playsound(screen, 0, SND_RETURN, 1, SNDPOS_RIGHT, SNDDIST_NEAR);
}
else if (cur_tool == TOOL_LABEL && label_node_to_edit)
{
@ -2955,6 +2960,14 @@ static void mainloop(void)
cursor_x = cursor_left;
cursor_y = min(cursor_y + font_height, canvas->h - font_height);
/* Reposition the on-screen keyboard if we begin typing over it */
update_canvas_ex(kbd_rect.x, kbd_rect.y, kbd_rect.x + kbd_rect.w,
kbd_rect.y + kbd_rect.h, 0);
update_screen_rect(&kbd_rect);
reposition_onscreen_keyboard(cursor_y);
playsound(screen, 0, SND_RETURN, 1, SNDPOS_RIGHT, SNDDIST_NEAR);
}
#ifdef SPEECH