• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

keyLocation.LEFT / .RIGHT won't work on a Mac keyboard

New Here ,
Apr 29, 2009 Apr 29, 2009

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 
        }
      }
    }
  }
}

TOPICS
ActionScript

Views

858

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 30, 2009 Apr 30, 2009

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 30, 2009 Apr 30, 2009

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 30, 2009 Apr 30, 2009

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...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 03, 2009 May 03, 2009

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 03, 2009 May 03, 2009

Copy link to clipboard

Copied

LATEST

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/

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines