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

@ -7,7 +7,7 @@ Various contributors (see below, and AUTHORS.txt)
http://www.tuxpaint.org/
2022.February.16 (0.9.28)
2022.February.17 (0.9.28)
* Improvements to "Paint" and "Lines" tools:
------------------------------------------
* Brush spacing may now be altered within Tux Paint.
@ -76,7 +76,11 @@ http://www.tuxpaint.org/
Closes https://sourceforge.net/p/tuxpaint/feature-requests/213/
Bill Kendrick <bill@newbreedsoftware.com>
* More instruction text are shown (and sound effects play) when
* Bugfix: Onscreen keyboard repositions itself to the top if you
use [Enter] to move the cursor down, and it begins overlapping
the keyboard.
* More instructional text is shown (and sound effects play) when
using the Label tool.
Bill Kendrick <bill@newbreedsoftware.com>

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