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 669 - remmapped keys not converted
Summary: remmapped keys not converted
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: events (show other bugs)
Version: HG 2.0
Hardware: x86 Linux
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-04 10:26 UTC by Edgar Simo
Modified: 2009-01-04 22:32 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Edgar Simo 2009-01-04 10:26:40 UTC
It looks like SDL 1.3 isn't remapping some keys.  How it works, you for example remap caps lock to escape, and when you press caps lock you'll get caps lock instead of escape when you should be getting escape because you remapped it to escape.  This works with SDL 1.2, but not with SDL 1.3.

Here is some stuff from the ML:


Reproduce by remapping Caps lock to Escape:


> You can set the behaviour with:
> > xmodmap -e 'clear lock'
> > xmodmap -e 'keycode 66 = Escape'

> > This is my xev output:

> > KeyPress event, serial 34, synthetic NO, window 0x1800001,
> >     root 0x7b, subw 0x0, time 1868946, (159,-94), root:(1259,712),
> >     state 0x0, keycode 9 (keysym 0xff1b, Escape), same_screen YES,
> >     XLookupString gives 1 bytes: (1b) "ape), same_screen YES,
> >     XLookupString gives 1 bytes: (1b) "es: (61) "a"
> >     XmbLookupString gives 1 bytes: (61) "a"
> >     XFilterEvent returns: False

> > KeyPress event, serial 34, synthetic NO, window 0x1800001,
> >     root 0x7b, subw 0x0, time 1871690, (159,-94), root:(1259,712),
> >     state 0x0, keycode 66 (keysym 0xff1b, Escape), same_screen YES,
> >     XKeysymToKeycode returns keycode: 9
> >     XLookupString gives 1 bytes: (1b) "cape), same_screen YES,
> >     XKeysymToKeycode returns keycode: 9
> >     XLookupString gives 1 bytes: (1b)


And checkkeys:


Sam Lantinga wrote:
>> You can set the behaviour with:
>> xmodmap -e 'clear lock'
>> xmodmap -e 'keycode 66 = Escape'
> 
>> This is my xev output:
> 
>> KeyPress event, serial 34, synthetic NO, window 0x1800001,
>>     root 0x7b, subw 0x0, time 1868946, (159,-94), root:(1259,712),
>>     state 0x0, keycode 9 (keysym 0xff1b, Escape), same_screen YES,
>>     XLookupString gives 1 bytes: (1b) "ape), same_screen YES,
>>     XLookupString gives 1 bytes: (1b) "es: (61) "a"
>>     XmbLookupString gives 1 bytes: (61) "a"
>>     XFilterEvent returns: False
> 
>> KeyPress event, serial 34, synthetic NO, window 0x1800001,
>>     root 0x7b, subw 0x0, time 1871690, (159,-94), root:(1259,712),
>>     state 0x0, keycode 66 (keysym 0xff1b, Escape), same_screen YES,
>>     XKeysymToKeycode returns keycode: 9
>>     XLookupString gives 1 bytes: (1b) "cape), same_screen YES,
>>     XKeysymToKeycode returns keycode: 9
>>     XLookupString gives 1 bytes: (1b)
> 
> What is the output of checkkeys with the latest subversion?
> (make clean; make install; cd test; ./configure; make checkkeys)
> 
> See ya!
> 	-Sam Lantinga, Founder and President, Galaxy Gameworks LLC
Comment 1 Edgar Simo 2009-01-04 10:28:36 UTC
Err damn, copied the wrong second email, sorry:


>> Sam Lantinga wrote:
>>> What is the output of checkkeys with the latest subversion?
>>> (make clean; make install; cd test; ./configure; make checkkeys)
> 
>> [bobbens@ghanima (~/src/SDL/test)] $ svn up
>> At revision 4347.
>> [bobbens@ghanima (~/src/SDL/test)] $ ./checkkeys
>> Sending text event
>> Unknown Key (scancode 41 = Escape) pressed  modifiers: (none)
>> Text:
>> Unknown Key (scancode 41 = Escape) released  modifiers: (none)
>> Sending text event
>> Key pressed :  scancode 57 = CapsLock, keycode 0x40000039 = CapsLock
>> modifiers: CAPS
>> Text:
>> Key released:  scancode 57 = CapsLock, keycode 0x40000039 = CapsLock
>> modifiers: CAPS
> 
> Okay, I see what's happening here.  We're not expecting non-alphanumeric
> keys to be remapped, so we're using the default mappings on X11.  Can you
> enter a bug in bugzilla for this?
> 
> Thanks!
> 	-Sam Lantinga, Founder and President, Galaxy Gameworks LLC

Comment 2 Sam Lantinga 2009-01-04 22:32:46 UTC
Fixed bug #669
Generate a full set of SDLKey mappings when setting up the keyboard layout
Committed revision 4357.