Jump to content

Shift or option modifier keys


Recommended Posts

I am trying to direct a script to bring up a different dialog box depending on if the shift or option keys are pressed when the command is invoked. I've tried to use KeyDown but am not clear how it works. There is a Shift and Option function as well but the results are not as expected. I am trying to do this with an IF/THEN statement. Any suggestions are appreciated. Using 2022 for this.

Edited by David Poiron
Link to comment

This is the code snippet

 

IF Shift THEN
			CreateDialog1 {full access}
ELSE
			CreateDialog2; {partial access}

 It does not seem to work - it just goes to CreateDialog2. I've tried Command and Option instead of Shift as well - not working. Is this required to be in a while..do statement to work?

Edited by David Poiron
Link to comment

Mine is very similar effectively becoming

 

If COMMAND then  Dialog Box;

 

With no else.

 

The Vectorscript manual says this about SHIFT (and also Command and Option) 

 

Shift returns TRUE if the Shift key was depressed during the last user event. This function operates with the MouseDown, KeyDown, AutoKey, GetPt, GetPtL, GetLine, and GetRect calls.

 

So you might need to include an Autokey or KeyDown ahead of your SHIFT to make sure it is set properly.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...