Re: Finding keyboard state in Cocoa(Ondra Cada)
Re: Finding keyboard state in Cocoa(Ondra Cada)
- Subject: Re: Finding keyboard state in Cocoa(Ondra Cada)
- From: Ondra Cada <email@hidden>
- Date: Tue, 28 Aug 2001 13:16:19 +0200
Tony,
>
>>>>> Tony (T) wrote at Mon, 27 Aug 2001 23:22:17 -0400:
T> >Of course there are, the aforementioned one. Get the modifiers from the
T> >NSEvent using the modifierFlags message.
T>
T> The problem is that my input is not keyboard.
It is, partially -- you are interested in the _keyboard_ modifier flags...
T> Imagine OCR or digitizer tablet or voice input that doesn't recognize the
T> case.
T> So I start the app, my input sends me letter "o" and want to know if
T> Caps Lock is pressed because then I will turn it into "O".
...whose changes are correctly (in MOSXS1, not checked in OSX) reported
through flagsChanged:
T> So, if Carbon has the means to do this, if Windows does, if Java also
T> has since 1.3 Toolkit.getLockingKeyState() methods to find the initial
T> state of these keys, why not App Kit?
This is alas true: the flagsChanged _should_ be called when the view becomes
the first responder with the current state. You might want to fill it as a
bug.
Otherwise, just use any other event (eg. a mouse click, or the currentEvent)
to get the current event state.
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc