macOS fix for backspace in text/label tools in some languages

Fixed the issue with the backspace not working in text and label tools
when in certain language modes in macOS.  Mac keyboards have the DELETE
key where PC keyboards have the BACKSPACE key, and the two keys have
different keycodes, so the backspace requires special handling on the
macOS in programs writtens for the PC.
This commit is contained in:
Mark Kim 2022-02-13 17:09:17 -05:00
parent 3d4dd494b5
commit c126eb92b5
2 changed files with 11 additions and 0 deletions

View file

@ -199,6 +199,12 @@ http://www.tuxpaint.org/
* Fonts are now also looked for in the system preferences path,
/Library/Application Support/TuxPaint/fonts
* Fixed the issue with the backspace not working in text and label tools
when in certain language modes in macOS. Mac keyboards have the DELETE
key where PC keyboards have the BACKSPACE key, and the two keys have
different keycodes, so the backspace requires special handling on the
macOS in programs writtens for the PC.
* Documentation updates:
---------------------
* macOS Apple Silicon and Universal Binary build instructions

View file

@ -2825,6 +2825,11 @@ static void mainloop(void)
/* Queue each character to be displayed */
while (*im_cp)
{
#ifdef __APPLE__
/* Apple uses DEL for BACKSPACE */
if (*im_cp == SDLK_DELETE) *im_cp = L'\b';
#endif
if (*im_cp == L'\b')
{
/* [Backspace] */