• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Control/Option keys both set "control" modifier flag in NSEvent
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Control/Option keys both set "control" modifier flag in NSEvent


  • Subject: Re: Control/Option keys both set "control" modifier flag in NSEvent
  • From: Ron Fleckner <email@hidden>
  • Date: Sun, 7 Oct 2007 15:35:06 +1000


On 07/10/2007, at 10:59 AM, Dale Miller wrote:
. To my surprise, the "NSFlagsChanged" envent for the key press
returns the following:
a) left control down: keycode = 59 flags = 0004 (control key) keymask = <0,8,0,0>
b)left option down keycode = 59 lfags = 0004 keymask = <0,8,0,0>
right option down keycode = 62 flags = 0004 keymask = <0,8,0,0>
right control down keycode = 62 flags = 0004 keymask = <0,8,0,0>
Any clues as to why this is happening?

Hi Dale,

no I don't know why it's happening in your case, but the keyCodes for the modifier keys on either side are:

// 55 = key code for left command key, 54 for right command key

// 59 = key code for left control key, 62 for right control key

// 58 = key code for left option key,  61 for right option key

// 56 = key code for left shift key,   60 for right shift key

I used NSLog(@"%p, %d", [event keyCode], [event keyCode]); inside - (void)flagsChanged:(NSEvent*)event to find out.

I used a sublclass of NSWindow for this in a mini-test app. Maybe your issue has something to do with using a subclass of NSApplication?? Dunno, just guessing.

HTH,
Ron
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Control/Option keys both set "control" modifier flag in NSEvent (From: Dale Miller <email@hidden>)

  • Prev by Date: NSTextField in NSWindow using setAlphaValue
  • Next by Date: Re: What is Object Class Name used for in bindings?
  • Previous by thread: Control/Option keys both set "control" modifier flag in NSEvent
  • Next by thread: detect button selection in NSMatrix
  • Index(es):
    • Date
    • Thread