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 618 - Windows dead key behaviour inconsistent with other platforms
Summary: Windows dead key behaviour inconsistent with other platforms
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: events (show other bugs)
Version: HG 1.2
Hardware: x86 Windows (All)
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-30 12:23 UTC by Tim Angus
Modified: 2009-04-13 01:42 UTC (History)
3 users (show)

See Also:


Attachments
Patch which makes win32 dead key behaviour consistent with other platforms (1.05 KB, patch)
2008-08-30 12:24 UTC, Tim Angus
Details | Diff
Patch which makes win32 dead key behaviour consistent with other platforms and correctly respects the state of numlock key (1.62 KB, patch)
2009-04-02 08:33 UTC, Tim Angus
Details | Diff
Only set the unicode, not the keysym (1.59 KB, patch)
2009-04-02 10:12 UTC, Amanieu d'Antras
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Angus 2008-08-30 12:23:56 UTC
As we all know SDL 1.2 doesn't handle dead keys well since one key press potentially equals two (or more) characters. For example, on many layouts, keying <backquote>,<space> results in <no character>,<backquote><space>. Since the unicode member of the SDL_keysym struct only has room for one character, only one can be returned.

On Linux, the first character is returned. On Windows however, unless the exact number of characters generated by the keypress is 1, nothing is returned. The following patch addresses this inconsistency.
Comment 1 Tim Angus 2008-08-30 12:24:42 UTC
Created attachment 268 [details]
Patch which makes win32 dead key behaviour consistent with other platforms

Aforementioned patch.
Comment 2 Tim Angus 2009-04-02 08:33:00 UTC
Created attachment 314 [details]
Patch which makes win32 dead key behaviour consistent with other platforms and correctly respects the state of numlock key

Updated patch which includes a further fix to the handling of the numpad when numlock is on. This further fix is courtesy Amanieu d'Antras.
Comment 3 Amanieu d'Antras 2009-04-02 09:54:07 UTC
That patch was really only intended for use in ioq3, since it make numpad keys return the same keysym as normal number keys when numlock is on. This was done because ioq3 will still interpret the keysym and therefore cause a HOME while typing a 7 on the numpad. The clean way to do this is to make a separate keysym for numpad keys when numlock is on or off.
Comment 4 Tim Angus 2009-04-02 10:05:12 UTC
OK, lets stick to the original patch then.
Comment 5 Amanieu d'Antras 2009-04-02 10:12:55 UTC
Created attachment 317 [details]
Only set the unicode, not the keysym

This patch doesn't override the keysym, and therefore should be appropriate for SDL.
Comment 6 Sam Lantinga 2009-04-13 01:42:28 UTC
This was checked in as revision 4484.

Thanks!