June 14, 200520 yr Newbies Hi all, Sorry if this has been asked 50 times already, but a quick search didn't help. I would like to have a button on a layout that when shift clicked will run one script, and when option clicked will run a different script. This seems like a common thing to want to do, but I can't figure it out. Is it possible or do you have to resort to something like apple script or something? I am using FM6 in a Mac environment. Thanks, Mark
June 14, 200520 yr If [ Status(CurrentModifierKey) = 1 or Status(CurrentModifierKey) = 3 ] #Shift (or Shift + CapsLock) key pressed. <perform stuff here> Else <Perform other stuff here> End If
June 14, 200520 yr You can run different branches of the same script: If [ Mod ( Status(CurrentModifierKeys) , 2) ] # Do something Else # Do something else End If To split the actions into separate scripts: If [ Mod ( Status(CurrentModifierKeys) , 2) ] Perform Script [ "some script"] Else Perform Script [ "another script"] End If
June 14, 200520 yr I see Vaughan has provided a similar answer, but there is a difference: Mod ( Status(CurrentModifierKeys) , 2) will return true when Shift is pressed, irregardless of any other modifier key. So if the user is pressing Shift+Control, or Shift+Command, or any other combination, as long as the Shift key is one of the active modifier keys, the Shift key will be recognized.
June 14, 200520 yr Author Newbies Thanks very much to both of you! It all seems so simple now. Thanks for pointing out the bit with the Mod Mark
Create an account or sign in to comment