Title lvledit: Shifted characters cannot be typed in map labels
Priority bug Status resolved
Assigned To fluzz Keywords editor
Linked issues lvledit: Map Label Text Input on Win32
View: 234
Watchers fluzz

Submitted on 2011-07-24 19h07 by tracker_migration, last changed by fluzz.

Author: tracker_migration Date: 2011-03-31   19h36
Submitted by curtmack
Tested on Windows 7 64-bit, might be Windows-only.

When editing or creating a map label in the editor, you cannot use shifted characters that are not capital letters; instead, the game types the unshifted equivalent. Additionally, the keypad /*-+ characters do not work; they simply don't print anything.
Author: tracker_migration Date: 2011-04-05   22h30
Posted by npepinpe
I can confirm this bug on Mac OSX 10.6.7 with revision 4388; I'll check it out now.
Author: tracker_migration Date: 2011-04-06   00h04
Posted by npepinpe
Put up a partial fix for /*-+. characters:
I will work on the rest later, unless someone wants to take it up.
Author: tracker_migration Date: 2011-04-06   02h30
Posted by curtmack
I've been able to fix it by making getchar_raw return the unicode component of the SDL key event if that component exists, but I'm not sure if that breaks anything else.
Author: tracker_migration Date: 2011-04-06   04h46
Posted by npepinpe
Yeah, we should probably support Unicode if we ever want people to use characters like \u00e0, \u00fc and such.
Author: tracker_migration Date: 2011-04-06   11h33
Posted by hakzsam
Not a bug.

It's a limitation of toupper (see the manpage)
"If c is not an unsigned char value, or EOF, the behavior of these functions is undefined."

For the /*-+ symbols, I'm not sure that is really needed.
Author: tracker_migration Date: 2011-04-06   11h42
Posted by hakzsam
And the details of what constitutes an uppercase or lowercase letter depend on the current locale.
Author: tracker_migration Date: 2011-04-06   17h35
Posted by curtmack
But SDL can parse all of that for us. See the documentation for SDL_EnableUnicode and SDL_keysym. toupper shouldn't be needed in this case.
Author: tracker_migration Date: 2011-04-10   19h17
Posted by npepinpe
Perhaps when we are expecting textual input (i.e.: labels) it would be good to use SDL's internal text input functions. More info ->

Seems like it would save us a lot of work.
Author: tracker_migration Date: 2011-04-11   18h48
Posted by curtmack
It doesn't look like there's an easy way to force SDL to start with default text, which is required by the current solution. I think the Unicode solution will be easier to work into the rest of the code.
Author: tracker_migration Date: 2011-04-12   06h40
Posted by ahuillet
The TextInput routines are as far as I know part of SDL 1.3 so this isn't an option.

As for Unicode - please avoid it.
Author: tracker_migration Date: 2011-04-12   17h51
Posted by curtmack
This solution wouldn't actually use Unicode. It would get information from SDL in Unicode because that's the form SDL provides it in, but any values outside the ASCII range would be ignored.
Author: salimiles Date: 2011-11-15   21h15
This looks linked to issue 234. Also rb1046 was submitted. Do either of these
issues still occur?
Author: jesusalva Date: 2018-01-13   03h03 actually promises to fix this bug.
Must be playtest on win32, though.
Author: fluzz Date: 2018-03-06   16h28
Fixed in commit 6423bb39f
Date User Action Args
2018-03-06 16:28:01fluzzsetstatus: open -> resolved
assignedto: fluzz
messages: + msg3545
nosy: + fluzz
2018-01-13 03:03:01jesusalvasetmessages: + msg3531
2011-11-15 21:15:24salimilessetmessages: + msg1990
linked: + lvledit: Map Label Text Input on Win32
2011-11-15 21:14:30salimileslinkissue234 linked
2011-11-15 21:11:24salimilessettitle: Shifted characters cannot be typed in map labels -> lvledit: Shifted characters cannot be typed in map labels
2011-07-26 07:52:13ahuilletsetkeyword: + editor
title: EDITOR: Shifted characters cannot be typed in map labels -> Shifted characters cannot be typed in map labels
2011-07-24 19:07:42tracker_migrationcreate