Copy link to clipboard
Copied
I want to differentiate the LEFT SHIFT key on the keyboard from the RIGHT SHIFT key. The code below will do that on my PC Laptop but not on my Macbook Pro. Someone knows a workaround or the reason why?
Thanks!
-Marek
PS: the sample code below is not from me.
PPS: when I trace event.keyLocation I always get 0 no matter which SHIFT key I press.
package { import flash.display.*; import flash.events.*; import flash.ui.*; public class RightShift extends Sprite { public static const A_KEY:int = 65; public function RightShift() { super() stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownListener); } private function keyDownListener (event:KeyboardEvent):void { if (event.keyCode == Keyboard.SHIFT) { trace("is SHIFT"); //works on Mac and PCso far if (event.keyLocation == KeyLocation.LEFT) { trace("The left Shift key was pressed"); //works on PC but doesn't work on mac os x } else if (event.keyLocation == KeyLocation.RIGHT) { trace("The right Shift key was pressed"); //works on PC but doesn't work on mac os x } } } } }
Copy link to clipboard
Copied
Even using the OS's Keyboard Viewer, the two shift keys are triggered at the same time. That's true on my MacBook Pro internal keyboard, an extended keyboard, and the same is true with the extended keyboard on my G5.
Maybe it's just not supported by the system?
Copy link to clipboard
Copied
>Maybe it's just not supported by the system?
It is! When you go to the Expose Preferences you can chosse between left and right SHIFT for a hotkey.
Copy link to clipboard
Copied
That does seem to be the case. I'll ask around.
You know, you could cause havoc on someone by setting Exposé to trigger when the shift keys are pressed...
Copy link to clipboard
Copied
Any news on my SHIFT case?
Can I send this somehow to Adobe so they can fix this someday? How would I do that?
Copy link to clipboard
Copied
I did ask the right people, but so far they haven't responded. You could also go here and log it as a bug:
http://bugs.adobe.com/flashplayer/