• 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: Determining Spotlight hot keys
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Determining Spotlight hot keys


  • Subject: Re: Determining Spotlight hot keys
  • From: nino <email@hidden>
  • Date: Fri, 10 Jun 2005 15:05:07 +0200

Can something like this will suffice?

property modkeys : {command down, option down, control down, shift down}
on getmodifiers(v)
    set l to {}
    repeat with i from 20 to 17 by -1
   if (v div (2 ^ i)) mod 2 =1 then set end of l to item (21 - i) of modkeys
    end repeat
    return l
end getmodifiers

By the way shift decimal value should be 131074
nino

> This is related to me query about "bitwise operations". I'm trying to
> figure out what key and modifiers are set for Spotlight by reading
> the com.apple.spotlight.plist. The key is straightforward and can be
> issued as is via "key code", but the modifiers are encoded as large
> numbers and "key code" takes a key code and a list such as this:
> {command down, shift down}. I find that adding the key code and
> modifier values and using that as the "key code" does not produce the
> desired result. So instead I'm trying to figure out which bits are
> set in the modifier value so I can determine the proper modifier
> keys. It appears that the modifier value is encoded as follows:
>
> KEY       DECIMAL    BINARY
> -------   -------    --------------------------
> command   1048576    1 0000 0000 0000 0000 0000
> option     524288    0 1000 0000 0000 0000 0000
> control    262144    0 0100 0000 0000 0000 0000
> shift      393216    0 0010 0000 0000 0000 0000
>
> So I just need to test each of those bits and that gives me the
> modifier keys and then I can invoke Spotlight without needing to have
> the user set properties that reflect the current spotlight key settings.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: Recognizing packages
  • Next by Date: RE: Problem setting a script to check for a running app
  • Previous by thread: Re: Determining Spotlight hot keys
  • Next by thread: Acrobat 6 question ... Reduce File Size...
  • Index(es):
    • Date
    • Thread