• 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: Command Key physical key down
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Command Key physical key down


  • Subject: Re: Command Key physical key down
  • From: Henry McGilton <email@hidden>
  • Date: Thu, 2 Oct 2003 19:36:44 -0700

On Thursday, October 2, 2003, at 11:51 AM, Greg Titus wrote:

On Thursday, October 2, 2003, at 11:24 AM, robert l clair wrote:

Can someone point me to a lead on how to get the actual key press
for the command and other modifier keys ? (As opposed to determining
whether they are up or down when another key is pressed.)

Implement the method -flagsChanged: in an NSResponder (view/window/whatever). It will get called when modifier keys go up or down exactly the same way as -mouseDown:/-mouseUp: or > -keyDown:/-keyUp:



Thanks Greg for pointing this one out.

For completeness, there is another way to get key down information in the
context of methods such as mouseMoved, where you would use the
NSEvent -modifierFlags method and then masking with the key
masks defined in the NSEvent documentation. The masks are all
of the form NSxxxxxxxxxxKeyMask.

My slightly different requirement is to watch for the Option key
going down while tracking the mouse in the mouseMoved method
of a view.

Best Wishes,
........ Henry


===============================+============================
Henry McGilton, Boulevardier | Trilithon Software
Objective-C/Java Composer | Seroia Research
-------------------------------+----------------------------
mailto:email@hidden | http://www.trilithon.com
|
===============================+============================
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Command Key physical key down (From: Greg Titus <email@hidden>)

  • Prev by Date: Re: best way to test for NSString / NSCFString type of object?
  • Next by Date: Trivial NSOpenPanel Question...
  • Previous by thread: Re: Command Key physical key down
  • Next by thread: Re: Command Key physical key down
  • Index(es):
    • Date
    • Thread