Re: Determining Spotlight hot keys
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