I was wondering if it's possible to have custom shut-down logic (like how using puling raw events allows for custom termination).
The way I think of it would be, if there some event that gets fired when the computer shuts down (or reboots), then that could be used.
I guess my question is, is this even possible? And how could you do it?
I do have one other idea using a persistent state machine, if the state is not shut down while the program is starting then, do something.
Custom Shutdown Logic
Started by Lupus590, Mar 09 2015 09:03 AM
2 replies to this topic
#1
Posted 09 March 2015 - 09:03 AM
#2
Posted 09 March 2015 - 10:13 AM
I believe that this is on not to suggest list: here .
As for implementing something like that? You can kinda detect when player is calling shutdown or reboot by looking at keyboard input and looking for ctrl+s/r combos. But that is unreliable right now with no key_up events. In future? yea it will be possible to detect player input shutdowns and reboots. In all other cases where shutdown is caused by peripheral or program code itself it gives no warning.
As for implementing something like that? You can kinda detect when player is calling shutdown or reboot by looking at keyboard input and looking for ctrl+s/r combos. But that is unreliable right now with no key_up events. In future? yea it will be possible to detect player input shutdowns and reboots. In all other cases where shutdown is caused by peripheral or program code itself it gives no warning.
Edited by wojbie, 09 March 2015 - 10:17 AM.
#3
Posted 09 March 2015 - 12:14 PM
I guess if you had an OS you could get it to queue a termination event when the player tells the OS to shutdown (via onscreen button).
One problem with watching for the keyboard inputs is:
I understand though, that if the OS was waiting for a program then having ctrl-r/s as a safety net for crashes is pointless
One problem with watching for the keyboard inputs is:
ctrl-r detected, I now have ~3 seconds to tell everything to turn off that is not enough time! *several bangs and clangs from rushing* oh dear... out of tim- craftOS >
I understand though, that if the OS was waiting for a program then having ctrl-r/s as a safety net for crashes is pointless
Edited by Lupus590, 09 March 2015 - 12:27 PM.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











