• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Detecting a keydown or key up.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Detecting a keydown or key up.


  • Subject: Re: Detecting a keydown or key up.
  • From: Luther Fuller <email@hidden>
  • Date: Wed, 03 Aug 2011 13:52:42 -0500

Two comments ...

On Aug 2, 2011, at 6:35 PM, Luther Fuller wrote:

on run
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?

 _______________________________________________
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

  • Follow-Ups:
    • Re: Detecting a keydown or key up.
      • From: Axel Luttgens <email@hidden>
    • Re: Detecting a keydown or key up.
      • From: "Zavatone, Alex" <email@hidden>
References: 
 >Re: Detecting a keydown or key up. (From: Shane Stanley <email@hidden>)
 >Re: Detecting a keydown or key up. (From: Luther Fuller <email@hidden>)

  • Prev by Date: Re: The PERILS of using SED in Applescript. Le solution!
  • Next by Date: Re: Detecting a keydown or key up.
  • Previous by thread: Re: Detecting a keydown or key up.
  • Next by thread: Re: Detecting a keydown or key up.
  • Index(es):
    • Date
    • Thread