Determining Spotlight hot keys
Determining Spotlight hot keys
- Subject: Determining Spotlight hot keys
- From: Stephen Jonke <email@hidden>
- Date: Wed, 8 Jun 2005 11:27:13 -0400
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.
I.e. I need "bitwise AND"
Steve
_________________________________________________________________
Stephen Jonke email@hidden
_______________________________________________
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