We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2853 - Windows Text Input events are not processed from `alt` codes at all.
Summary: Windows Text Input events are not processed from `alt` codes at all.
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: events (show other bugs)
Version: HG 2.1
Hardware: All Windows (All)
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-24 03:32 UTC by ensiform
Modified: 2017-08-13 20:54 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ensiform 2015-01-24 03:32:00 UTC
The Windows input events code seems to ignore any WM_*CHAR events being sent via TranslateMessage().  Thus preventing people from using ALT codes for text input purposes.  AFAIK Windows still sends all of the key presses as keypresses as WM_[SYS]KEY[DOWN|UP] during such time.  They may however be WM_SYSKEYDOWN because alt is being held.  However, once alt is released it also sends the WM_CHAR because of TranslateMessage.

Perhaps Windows textinput could be moved to WM_CHAR directly instead of via the keydown events to allow this to work?  This would be useful even without Unicode support especially when applications may still allow the extended ASCII code pages such as 1252 for the 0-255 range for people who don't have foreign keyboards.
Comment 1 Daniel Gibson 2015-02-12 01:17:22 UTC
I think https://bugzilla.libsdl.org/show_bug.cgi?id=2834 is related - dead keys also don't work with the current "generate unicode char from key hack", because with dead keys the char is generated from two key presses.

I think SDL should (only) use WM_CHAR and WM_UNICHAR for textinput.
Comment 2 Sam Lantinga 2017-08-13 20:54:30 UTC
This works with the latest SDL snapshot:
http://www.libsdl.org/tmp/SDL-2.0.zip

INFO: Key pressed :  scancode 226 = Left Alt, keycode 0x400000E2 = Left Alt  modifiers: LALT NUM (repeat)
INFO: Key pressed :  scancode 98 = Keypad 0, keycode 0x40000062 = Keypad 0  modifiers: LALT NUM
INFO: Key released:  scancode 98 = Keypad 0, keycode 0x40000062 = Keypad 0  modifiers: LALT NUM
INFO: Key pressed :  scancode 89 = Keypad 1, keycode 0x40000059 = Keypad 1  modifiers: LALT NUM
INFO: Key released:  scancode 89 = Keypad 1, keycode 0x40000059 = Keypad 1  modifiers: LALT NUM
INFO: Key pressed :  scancode 97 = Keypad 9, keycode 0x40000061 = Keypad 9  modifiers: LALT NUM
INFO: Key released:  scancode 97 = Keypad 9, keycode 0x40000061 = Keypad 9  modifiers: LALT NUM
INFO: Key pressed :  scancode 91 = Keypad 3, keycode 0x4000005B = Keypad 3  modifiers: LALT NUM
INFO: Key released:  scancode 91 = Keypad 3, keycode 0x4000005B = Keypad 3  modifiers: LALT NUM
INFO: Key released:  scancode 226 = Left Alt, keycode 0x400000E2 = Left Alt  modifiers: NUM
INFO: INPUT Text (\xc3\x81): "Á"