ZBrushCentral

ikeypress question, please help

hey guys, please help me out on this one.

I wanted to create buttons for a touch pc (no keyboard on that one) to simulate alt, control and shift keyboard keys. These are the keys that as all of you know are essential for quick modeling work flow.

So i read about zscript on the zbrush wiki and tried to recreate an undo button as a proof of concept.

here is the script

[ISubPalette,“zplugin:buttons”]

[IButton
,“zplugin:buttons:UNDO”,“undo”,[IKeyPress,CTRL’z’]]

the button shows up but it doesn’t do what i wanted it to do which is undo stuff. It also doesn’t give an error message.

Does the ikeypress function work like this at all?

If not, Is there maybe a different way of simulating a button that I can push with a finger on my left hand (touchscreen) while drawing with a pen on the computer screen?

I don’t think there’s a way to get IKeyPress to work on its own - the command needs to be wrapped around some other action, such as a canvas stroke or a button press. For example:

[IKeyPress,SHIFT,[IPress,Tool:Geometry:Crease]]

will crease all edges of a model.

thanks Marcus. I couldn’t get it to work after playing around with different ways of writing the code. I noticed that I was missing a + and a , in the code I posted and after fixing that I got your example to work.
Here is something weird though. Ikepress works just like that (without the other action) for the spacebar but not for ctrl alt or shift.

I found a really nice overlay touch interface that allowed me to kinda do what i wanted.