Re: Finding keyboard state in Cocoa
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