how to turn off computer using ESC key
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.
You could experiment with launching a shell script (using the
shell object) which contains a
shutdown command. However, I’ve never tried it.
You will likely have a much easier time doing this with the free trial of Controllermate.
Presuming you’re working on a Mac:
<code>-- Pasted Max Patch, click to expand. --Copy all of the following text. Then, in Max, select New From Clipboard.----------begin_max5_patcher---------- 713.3ocuUErbZCCD8L7UritvERBXmDH4VOzY58N8ToSGg8BVo1RdjjwPyz+8 tZsH.MDlLjjdw1Zk0yO8duU9w98DyMqQm.tG9Nzq2i860iKEJzKNtmnRtNqT 53WSjYppPsWLraNOt1y0+TccI5xrpZOTg9BS98yz9BkCjkklVGrwz.dC3JZ7 4lVcXrEHzpa7nEZUzRZ7fu.AMh4fYA+rLuRoUNuU5M1ANvpVV3GBJdVKBA70 a.SMpAIQAUlzqLZFOnQ6jqHrVnHpMDxUxRyRZJcdfPspxRhNlVnol.IGbdSM +Qehi0VSFRa73lsTowLSil2w2FKpaHFVhdVdFGKVaQGoRLW9oEy7cRbxjoWN ZHjDtLJdA9wNfHEXKRihUWXWNmGe41J0ReVgRubObuN85.ZiGyne8sgaSR1C 6EFsWKqP1p9BVtB8jRsceox45l4ObwTwdqvo9Muh.tgp+oe+vkguwnxLw2zp 0wTxLwL8wCJxEX4lcdw1DRvwncOa6G3nyzzJGPdJmeHDZzQFvlJQKODbPPo4 BWg9rqbM4Fz53HxvvhjqLp7XJ.IvjteE9ZARsvX6lnoFsMNJ0VSa0ViM+nAj ImJf7FL6NWN502vYooomiWO4czqqn1D4R7YdswIiGJbABC7rhtWa5LwW237X E74UjO4lI1dDAD77AhiIgIwhc5meSM1oKBwKzJM9DMNI2vhYRmZdWWazMmiZ dy+A0LjV20QbQAnMse3ZTLukbvsyRhReGkHM1RP9bEJzzJNUm2ykjgfXtTu7 kjljSHMi5NOO8tvszTVZlbNRy3Wgzvnxmw7O+wlYVn9g5ki9Ca11cYLhB63V N57JM2Gt26L9f2oPkmi58OhJW4jyKQl4G22dsrI8CjMcREcRyJ5v8HjLQnPz CF6S++VPAjtgb7PXwUpsueJWQZIS2SNdisyEWO8VQ+v24O8+Kb+EowH -----------end_max5_patcher-----------
[OT sorry] mmmm by the way, anyone knows if it is possible to easily disable the windows key, in windows ?
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?
I agree with jdudeo, autohotkey is the way to go.
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.
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.
Forums > MaxMSP