Getting the current state of the modifier keys
Getting the current state of the modifier keys
- Subject: Getting the current state of the modifier keys
- From: Jeffrey Mattox <email@hidden>
- Date: Sat, 22 Feb 2003 15:07:50 -0600
I have a Cocoa routine that gets a single keystroke or mouse click
event. If a modifier key is down, I want to wait until the modifier
key is released before proceeding. My routine only gets the one
event, not any others. Is there a way to test the current state of
the modifiers without getting another event?
I know how to test the event to see if a modifier key was on, but I
need to wait for the key(s) to be released.
Background: This will be a workaround for an apparent limitation in
AppleScript. My program uses AppleScript and the new Apple System
Events (1.2) to issue a "keystroke" command. If I send a keystroke
for, say the letter 'a' while the option key is down, System Events
actually sends an "option-a". I want to wait for the modifier keys
to be released, then I'll send the 'a'. I've found no way in
AppleScript to either "undo" the current modifier keys for the
keystroke command nor be notified when all modifier keys are released.
Jeff
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.