May 30, 200619 yr 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
May 30, 200619 yr 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
May 30, 200619 yr 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 )
Create an account or sign in to comment