Inky Phil Posted May 30, 2006 Posted May 30, 2006 I have a script that uses if get(activemodifierkeys) = 1 perform script endif to check if the shift key has been used. I have just noticed that if the caps lock key is in use this 'if' test fails even if one does press the shift key. Does anyone know of a change that I can make to the script that would work wether or not the caps lock key is in operation? TIA Phil
John Mark Osborne Posted May 30, 2006 Posted May 30, 2006 Just test for the total of the combined keys. Since the Shift = 1 and the Caps Lock key = 2, you can use the following formula in your If script step. Get(ActiveModifierKeys) = 1 or Get(ActiveModifierKeys) = 3
comment Posted May 30, 2006 Posted May 30, 2006 The Get(ActiveModifierKeys) function returns essentially a 4-bit binary number (5-bit on a Mac). Each bit represents the status of an individual modifier key. 'Shift' is the least-significant bit, and you can extract its status independently of ANY other modifier key (not just 'Caps Lock') by: Mod ( Get(ActiveModifierKeys) ; 2 )
Recommended Posts
This topic is 6754 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now