[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Detecting modifier keys



nghai <nghai@didi.com> writes:
>I have a question concerning the use of Mac::Events.
>
>Is it possible to use that to detect if a modifier key was pressed (eg. 
>Ctrl, Cmd, Opt, Shift).

Yes.

>I've tried to extract information from Mac::Events::$CurrentEvent

$CurrentEvent->modifiers would be the field to use, but it will only work
*while an event is being processed*. If you're testing it e.g. from within a
click method, this should be the case anyway, otherwise you'll have to install
a handler for e.g. nullEvents in Mac::Events and test in that handler.

Sorry to be so vague, but I'm not quite sure in what context you'd like to do
the test.

Matthias

-----
Matthias Neeracher   <neeri@iis.ee.ethz.ch>   http://www.iis.ee.ethz.ch/~neeri
   "I'm set free to find a new illusion" -- Velvet Underground

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch