• 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: Finding keyboard state in Cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finding keyboard state in Cocoa


  • Subject: Re: Finding keyboard state in Cocoa
  • From: Vince DeMarco <email@hidden>
  • Date: Sat, 25 Aug 2001 22:46:04 -0700

On Saturday, August 25, 2001, at 10:03 pm, Tony wrote:

AFAIC currently you must use Carbon GetKey to find, for example,
Caps Lock key state. Cocoa keyDown would not be called if you press
Shift key.

As there are apps where this functionality is important, mine being
one of them, are there plans to add it to Cocoa or are there ways
to get it that I am unaware of?


NSResponder has a method called flagsChanged:.

see the docs.


http://developer.apple.com/techpubs/macosx/Cocoa/Reference/ApplicationKit/
ObjC_classic/Classes/NSResponder.html

quoting form the docs

flagsChanged:

- (void)flagsChanged:(NSEvent *)theEvent

Informs the receiver that the user has pressed or released a modifier key (Shift, Control, and so on). NSResponder's implementation simply passes this message to the next responder.


References: 
 >Finding keyboard state in Cocoa (From: "Tony" <email@hidden>)

  • Prev by Date: Re: QT/OpenGL (Re: was Potential O'Reilly Cocoa books (was Docs))
  • Next by Date: Re: Books (was Re: Docs)
  • Previous by thread: Re: Cocoa patterns?
  • Next by thread: Re: Finding keyboard state in Cocoa
  • Index(es):
    • Date
    • Thread