• 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: Ondra Cada <email@hidden>
  • Date: Mon, 27 Aug 2001 17:47:47 +0200

Mike,

>>>>>> Mike Davis (MD) wrote at Mon, 27 Aug 2001 11:00:30 -0400:
> From: "Tony" <email@hidden>
MD> >AFAIC currently you must use Carbon GetKey to find, for example,
MD> >Caps Lock key state. Cocoa keyDown would not be called if you press
MD> >Shift key.

Of course -- why would it? The NSResponder's flagsChanged: method is made for that.

MD> I have to use that and it's skanky since it's a poll. I also had to
MD> subclass NSApplication to stop it sending Command key combos when I
MD> wanted to read them. I didn't like doing that.

This I don't quite understand -- you want to "override" the standard
Cmd-keys usage? If so, subclassing of NSApplication is truly indicated!

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

Of course there are, the aforementioned one. Get the modifiers from the
NSEvent using the modifierFlags message.
---
Ondra Cada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc


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

  • Prev by Date: Re: Testing if a folder is a bundle
  • Next by Date: Re: Cocoa patterns?
  • Previous by thread: Re: Finding keyboard state in Cocoa
  • Next by thread: Modal run loop input sources
  • Index(es):
    • Date
    • Thread