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 787

Summary: Left and Right modifier keys are indistinguishable
Product: SDL Reporter: jmgjazzum
Component: eventsAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED WORKSFORME QA Contact: Sam Lantinga <slouken>
Severity: minor    
Priority: P2 CC: ewmailing, jmgjazzum
Version: 1.2.13Keywords: target-1.2.14
Hardware: PowerPC   
OS: Mac OS X 10.5 (PPC)   
Attachments: Program to test keyboard input (press q to quit)

Description jmgjazzum 2009-09-02 18:09:51 UTC
Created attachment 349 [details]
Program to test keyboard input (press q to quit)

When I use the left and right control keys (for instance) on a Mac, I get the same keysim returned in the keyboard event.  As far as I can tell, all the right side modifiers report as left side.

For instance, when I run the attached program and press 'a', I get:

sdlevent.key.keysym.sym: 97
sdlevent.key.keysym.mod: 0
sdlevent.key.keysym.scancode: 0
sdlevent.key.keysym.unicode: a

If I press the left control button, I get:

sdlevent.key.keysym.sym: 306
sdlevent.key.keysym.mod: 0
sdlevent.key.keysym.scancode: 0
sdlevent.key.keysym.unicode: 

If I press the RIGHT control button, I get the same thing:

sdlevent.key.keysym.sym: 306
sdlevent.key.keysym.mod: 0
sdlevent.key.keysym.scancode: 0
sdlevent.key.keysym.unicode: 

Likewise for shift, alt, meta.  Has anyone else seen this on OS X?  I'm using 10.5 on a ppc.
Comment 1 Ryan C. Gordon 2009-09-13 16:33:35 UTC
Tagging this bug with "target-1.2.14" so we can try to resolve it for SDL 1.2.14.

Please note that we may choose to resolve it as WONTFIX. This tag is largely so we have a comprehensive wishlist of bugs to examine for 1.2.14 (and so we can close bugs that we'll never fix, rather than have them live forever in Bugzilla).

--ryan.
Comment 2 Eric wing 2009-09-13 22:17:06 UTC
I am not able to reproduce your problem. But, are you using a laptop instead of an actual keyboard? If so, I think I know what your problem is.

I think it was in Tiger (maybe Leopard) that Apple changed the way the modifier keys responded on their laptops. This basically made the left and right side keys indistinguishable (I think both registered as left-side keys).

I filed a bug with Apple as this used to work in Panther. But they said they won't fix it.

If you are using a desktop with a proper keyboard, left and right side modifier keys are still unique and distinguishable.
Comment 3 jmgjazzum 2009-09-14 07:48:38 UTC
No, it's not a laptop.  I'm using a late PowerMac G5 with Leopard and with a Logitech Wave USB keyboard.  Perhaps the problem is with the Logitech keyboard...  Is anyone else able to reproduce the problem?  I'll try the program with different keyboards and with the same keyboard on a different computer.
Comment 4 Eric wing 2009-09-14 08:10:33 UTC
I tested on both an Intel iMac and G5 iMac using their respective original keyboards. The sym codes did return unique values for the left/right keys I tested.
Comment 5 Eric wing 2009-09-14 08:12:09 UTC
Forgot to say, on Snow Leopard and Leopard respectively.