Run Script on ESC from Play mode Question

Greetings,

We were given the following info from you guys a while ago and I am now testing this. So far, it is not working, but I don’t know what I’m doing wrong. Can anyone help me on this? I’m including a .toe file that is set up the way it says below. I’m not totally sure where the TouchShortcuts.txt goes, so I put it in a couple places. And just to start, my script is trying to just echo, or run a ‘confirm’ command, but nothing happens, and the escape takes you into edit mode. I’d be so thankful for any help on this…


Markus Heckmann wrote:

It is possible to do that already:

in the container that holds the UI panel that is open add a container called local. In that container add a table dat with 3 columns called shortcuts
add a line to the table with these three columns: esc esc run myescscript

Now everytime you are hitting esc while the controlpanel is open, the script is run instead of closing the controlpanel. Should be easy now to build a dialog with a password field…

cheers
markus

First add a file in $HOME/touch/TouchShortcuts.txt
This file should hold a line saying “network.cancel”

LogicCore.toe (837 KB)

Sorry my mistake:

The correct path to put that txt file is C:\YourTouchInstallDirectory\touch\config

This will replace a TouchShortcuts.txt file that is already sitting there.

cheers
markus

thanks markus.

So far, it isn’t working for me.
i’ve added the line “network.cancel” to the existing TouchShortcuts.txt file in the config directory and I’ve tried it with ONLY that line in the file. i exited touch and got back in after editing the text file.

if i just run my script, it echoes and does the little ‘confirm’. but if i hit escape over the perform panel, the panel goes away, and my script does not run…help…

–kate

Hey Kate,

sorry about that. I just hit escape in the network view and that actually executes the script.
The esc key in Perform mode is reserved to close the window. If you want to prevent people from seeing the network than you would have to choose “Perform Mode with Privacy” on the “Start Mode:” Button Menu in the Window Placement.
Do you want to do further things than that?

markus

Hi Markus,

Yes, we were hoping to avoid using the rather ‘dangerous’ “Perform Mode with Privacy” setting. Dangerous, because once this is set, there is no way out. What we wanted, was to setup the ability to enter a password, so that IF some sort of node editing is needed, a qualified person would be able to do it. Do you think that we may be able to get this “Esc/Run script” functionality for the perform window? It would be the best solution for us, as we need to leave the client with a file in Perform mode, but need the ability for a password-enabled hook into the designer mode. Looking forward to your answer! :slight_smile:

thanks again for your fast responses!

–kate

What you could do though is use a start script that disables rendering of the main TouchDesigner window via

winplacement -d 0

then open up the controlpanel via the “controlpanel” command and make it always on top

Now inside the controlpanel have a Void COMP called local and inside there a table called shortcuts with the 3 columns:

network.cancel esc run /myscript

now when you startup touch it will open up your controlpanel, stop rendering of the main window and when you hit esc it should run your script.

I renamed the startscript in the attached file to “start1” so you can see it…
I wasn’t able to open the textport in any way after the controlpanel was open - so this seems pretty save to me. If i overlooked a case, please let me know.
test.toe (3.24 KB)

Thanks again, Markus.

I have to move onto a different issue right now, but I will test this tomorrow and let you know if this will solve our problem.
cheers,
–kate

Hi Markus,

I just have a question about the winplacement command. in the documentation (as well as the window for Commands and Expressions), i cannot find the meaning of the “-d 0 -f” that you have. what i’ll want to do in myscript, would be, upon receiving the proper password, i will re-instate the design window, using the winplacement command, but just wondering why you are using flags that i can’t find in the documentation…maybe i’m not looking in the right place…

–kate

Hi Kate,

the

winplacement -d 0

disables the drawing of the main window.

winplacement -d 1

enables it.

It was gone from the help but will be back in there.

the -f was misplaced somehow by me. It was intended to be for the Controlpanel command as in:

controlpanel -o /project1 -f

and enables the fullscreenmode

cheers
markus

Thanks for the explanation of flags, etc…

And this method looks like it IS the solution we were hoping for. :smiley:
Thanks SO much!!!
–kate