Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6754 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted

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

Posted

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 )

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.