Jump to content

(multiple) Active modifier keys


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

Recommended Posts

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

Link to comment
Share on other sites

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 )

Link to comment
Share on other sites

This topic is 5665 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
 Share

×
×
  • Create New...

Important Information

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