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 4874

Summary: Lack of unicode support breaks keyboard input in some applications.
Product: sdl12-compat Reporter: Lyle <lyle.tafoya>
Component: everythingAssignee: Ryan C. Gordon <icculus>
Status: NEW --- QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: unspecified   
Hardware: x86_64   
OS: Linux   

Description Lyle 2019-11-24 01:51:19 UTC
Some applications, such as the game Frozen Synapse and this legacy SDL tutorial from Lazy Foo http://www.lazyfoo.net/SDL_tutorials/lesson23/index.php pull keyboard input through event.key.keysym.unicode. Currently, this is always set to 0, which results in these applications failing to recognize any input. This occurs due to the following line in SDL12_compat.c:

    event12.key.keysym.unicode = 0;  FIXME("unicode");

However, since the unicode character set is a superset of ASCII, we can provide partial functionality here very easily just by passing through the sym value. For example:

    event12.key.keysym.unicode = event12.key.keysym.sym;

I'll admit that I don't know exactly what will happen here if someone does input a character which requires unicode support. However, I have verified that this change restores keyboard input functionality for me for the sign-in screen of the game Frozen Synapse as well as the above linked legacy Lazy Foo tutorial. Until such time that someone is prepared to fully implement the needed bits for unicode, I think this or something very much like it would be a change for the better.