Re: Detecting a keydown or key up.
Re: Detecting a keydown or key up.
- Subject: Re: Detecting a keydown or key up.
- From: "Zavatone, Alex" <email@hidden>
- Date: Wed, 03 Aug 2011 14:15:37 -0700
- Acceptlanguage: en-US
- Thread-topic: Detecting a keydown or key up.
Not sure it this will help or not.
on doubleClick_(sender) if current application's NSEvent's modifierFlags() is equal to (current application's NSAlternateKeyMask as integer) + (current application's NSCommandKeyMask as integer) then log "Double clicked with Command/Option(Alt) keys down" else log "Double clicked" end if end doubleClick_
On Aug 3, 2011, at 1:52 PM, Luther Fuller wrote: Two comments ...
On Aug 2, 2011, at 6:35 PM, Luther Fuller wrote: if checkModifier_(me) then -- "option" key is down display dialog "Option key down" else display dialog "Option key up" end if end run
This will quit correctly if I use this ...
on run try if checkModifier_(me) then -- "option" key is down display dialog "Option key down" else display dialog "Option key up" end if end try quit end run
And a question about this ... on checkModifier_(sender) set theMask to current application's NSAlternateKeyMask as integer set theFlag to current application's NSEvent's modifierFlags() as integer return ((theFlag div theMask) mod 2) as boolean end checkModifier_
I've looked everywhere I know to look, and can find no documentation on: 1. NSAlternateKeyMask and 2. current application Where else should I look?
<ATT00001..txt>
This email message and any attachments are for the sole use of the intended recipient(s) and may contain information that is proprietary to U.S. Foodservice, Inc and/or its subsidiaries or otherwise confidential or legally privileged. If you have received this message in error, please notify the sender by reply, and delete all copies of this message and any attachments. If you are the intended recipient you may use the information contained in this message and any files attached to this message only as authorized by U.S. Foodservice. Files attached to this message may only be transmitted using secure systems and appropriate means of encryption, and must be secured using the same level password and security protection with which the file was provided to you. Any unauthorized use, dissemination or disclosure of this message or it's attachments is strictly prohibited.
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden