Hi,
I am trying to enable multi function buttons as we did in ZBrush 2, in other words left clicking the button has one function and SHIFT + left clicking the same button has another function. In Zbrush 2 this worked fine using the [Sleep,…] command to detect modifier key press and release. It also seems to work fine in ZBrush 3 until you, for example, hold CTRL and hover over a button. The button description window is then moved to the top of the screen and flickers while the modifier key is pressed. It still works but the sideeffect is unacceptable.
This is the code I have used in ZBrush 2 that is causing trouble in ZBrush 3:
[VarDef, KeyPressID, 0]
[IButton, "Testing the sleep command", ,
[If, ((KeyPressID) & 256) = 256,
[Note, "Shift key held"]
[VarSet, KeyPressID, 0]
]
]
[Sleep,0.001,
[If, SleepResult == 64, // modifier pressed
[VarSet, KeyPressID, [IGet, Preferences:utilities:viewkeyboardstatus] ]
]
[If, SleepResult == 128, // modifier released
[VarSet, KeyPressID, 0]
]
[SleepAgain]
, 64 | 128 ,SleepResult
]
Not sure how to tackle this problem apart from creating buttons with separate functions which I really want to avoid in this script. I have tried various combinations of [SleepAgain,…] wake up values, alternating wake up values (depending on sleepresult) and also breaking down in tears. The latter helped clear my bunged up nose but apart from that, no luck.
Any ideas?