Forums > MaxMSP

how to turn off computer using ESC key


Jul 07 2013 | 2:51 am

hello.

I will make my patch running automatically as the computer boots,
I also want the user press ESC key to turn off the computer, as normal as possible.
I don’t want it to be forced shutdown.

thx.

Jul 07 2013 | 3:21 am

You could experiment with launching a shell script (using the shell object) which contains a shutdown command. However, I’ve never tried it.

HTH,
Ádám

Jul 07 2013 | 8:14 am

You will likely have a much easier time doing this with the free trial of Controllermate.

Jul 07 2013 | 11:39 am

Presuming you’re working on a Mac:

<code>
-- Pasted Max Patch, click to expand. --

</code>

on windows you can send the shutdown /s command via the
mxj class

Jul 07 2013 | 7:12 pm

If you’re on windows it might be easiest to use Auto Hot Key
http://www.autohotkey.com/

Jul 08 2013 | 1:50 am

[OT sorry] mmmm by the way, anyone knows if it is possible to easily disable the windows key, in windows ?

Feb 02 2017 | 6:44 am

Hey LSKA,

Could you drop off some example? I am also in the need of PC control via max, and project must to be in windows OS…
Unfortunately, mxj object is very poorly documented, reference do not says much, and I cannot find java-doc to read more about it…

What kind of class in mxj should be use to execute shutdown /s command?

Many thanks!

Feb 03 2017 | 11:48 pm

I agree with jdudeo, autohotkey is the way to go.

Feb 09 2017 | 12:10 pm

Hey to everyone who reads this thread

I found a nice solution to shutdown, restart or hibernate your pc from max.
Process is pretty simple.

First you need to create link with setting to shutdown your pc.
Here are link, that explains how to do it in different versions of windows.
http://www.computerhope.com/issues/ch000321.htm

After that you need to set in Max to run this link via message box.

; max launchbrowser yourlink.lnk

for example: ; max launchbrowser C:/User/me/Desktop/shutdown.lnk

once you click it, max will launch link, which triggers system to shutdown.
You can even use ; max quit then shutdown by using trigger b b, first quits max, then shutdown pc, or set it to ESC button or anything you like.

Hope this will help someone.

Viewing 9 posts - 1 through 9 (of 9 total)

Forums > MaxMSP