This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Egor305's profile picture

Shutdown And Restart Buttons

Started by Egor305, 01 September 2013 - 06:11 AM
Egor305 #1
Posted 01 September 2013 - 08:11 AM
I suggest, that computers (and turtles?) should have little sidebar in gui, that have shutdown and restart buttons.
I know that there's Ctrl-S and Ctrl-R, but sometimes, it's annoying when you need to hold Ctrl-R for 3 seconds. And sometimes you need to do it like 10 times in a row.
It's should be something like that: (well not exactly like that)
Terminate button will be cheaty, cause you can do os.pullEvent=os.pullEvenRaw and use it as extra button.
Zudo #2
Posted 01 September 2013 - 08:26 AM
I second this idea!
Kingdaro #3
Posted 01 September 2013 - 08:32 AM
Thirded. Can't believe we don't have this already.
theoriginalbit #4
Posted 01 September 2013 - 09:25 AM
Fourthded (nice word eh? :P/>) I do think it would make sense to have a GUI element to do these hard coded shortcuts. It adds for better compatibility, we can just say "click the button" instead of "press this button, unless you're in this locale, then press that one" :P/> Also to agree with OP even more, I have had times where the shortcuts just weren't being detected and I had to try it multiple times, so I think buttons would work nicely!
Engineer #5
Posted 01 September 2013 - 10:23 AM
I … it! Yea, I dont know the word for it if its even one xD
But this will come in handy if the shell coroutine errored, you can easily restart the pc. Because then it most of the time doesnt detect the shortcut keys. I really support this since my program lately stops the shell coroutine a lot!
M4sh3dP0t4t03 #6
Posted 01 September 2013 - 10:48 AM
I also support this idea. But I think a power button would be enough and there is no need for a restart button(because you could just click the power button two times).
Zudo #7
Posted 01 September 2013 - 10:50 AM
I also support this idea. But I think a power button would be enough and there is no need for a restart button(because you could just click the power button two times).
I think that shutdown, restart and terminate would be best
electrodude512 #8
Posted 01 September 2013 - 11:12 AM
I also support this idea. But I think a power button would be enough and there is no need for a restart button(because you could just click the power button two times).

I agree with you; only a power button, no shutdown button.

This shutdown button should call os.shutdown() as opposed to just terminating the computer in case the user wants to override os.shutdown().

There shouldn't be a terminate button, but it would be nice ^T didn't take so long - instead, pushing ^T should immediately fire a terminate_warn event or something to that effect, and then the real terminate event will fire 3 seconds later like it does now. That way, you can terminate programs (that haven't crashed) more quickly. But this terminate_warn event can be easily done in code by a keyboard handler daemon.
theoriginalbit #9
Posted 01 September 2013 - 11:57 AM
I also support this idea. But I think a power button would be enough and there is no need for a restart button(because you could just click the power button two times).
Would also work fine


I think that shutdown, restart and terminate would be best
I don't so much agree with terminate. It could cause problems if people override it in their programs, they could turn around and complain to Dan/Cloudy saying the button isn't working.


This shutdown button should call os.shutdown() as opposed to just terminating the computer in case the user wants to override os.shutdown().
I don't agree with this, I feel that the usage of this button would better suit to use the Java-side shutdown over the Lua-side.

There shouldn't be a terminate button, but it would be nice ^T didn't take so long - instead, pushing ^T should immediately fire a terminate_warn event or something to that effect, and then the real terminate event will fire 3 seconds later like it does now. That way, you can terminate programs (that haven't crashed) more quickly. But this terminate_warn event can be easily done in code by a keyboard handler daemon.
Uhhh what? there is a "terminate" event, this is given to the program when CTRL+T is held so that the program can handle it appropriately, whether it is to nicely quit, or to prevent terminating… Basically as it stands now, when people use any yielding functions (i.e. sleep, read, any turtle or http function, etc) those functions call `os.pullEvent`, which in turn calls `os.pullEventRaw`, which in turn calls `coroutine.yield`. The program waits at `coroutine.yield` until an event occurs, the event then gets passed all the way back to `os.pullEvent` it is in here that the "terminate" event is processed like so

function os.pullEvent( filter )
  local event = { os.pullEventRaw(filter) }
  if event[1] == "terminate" then
    error("Terminated", 0)
  end
  return unpack(event)
end
So basically what I'm saying here it that programs can be made in a way that doesn't terminate a program when CTRL+T is pressed so there is no need to having a "terminate_warn" event.
Engineer #10
Posted 01 September 2013 - 12:57 PM
Simply a power button will do. To compare it to real life:
where is your terminate button?
where is your reboot button?

And please dont say 'go to start and click there on reboot'. Im talking about the hardware.
theoriginalbit #11
Posted 01 September 2013 - 12:58 PM
where is your reboot button?
Well actually I used to have a full tower that had power, reboot, and sleep buttons on it.
Egor305 #12
Posted 01 September 2013 - 01:23 PM
Wow, didn't know so many people will care about this…
How about SysRq button that will trigger "sysrq" event? It's like just what i said about terminate button, but terminate button is overpowered
ElvishJerricco #13
Posted 01 September 2013 - 01:55 PM
I like the idea well enough. But it's not hard to do this yourself in code as long as you're using an advanced computer. For that reason I could easily see one of the devs saying this idea's not gonna make it in.
Sebra #14
Posted 01 September 2013 - 02:22 PM
Idea is quite good really.
Power and Reset buttons like on real life computers.
I would not be against Terminate and would be glad if System key added to throw special event.
Place them on the border as small icons. Like window icons. May be with mouseover hints.
Zudo #15
Posted 01 September 2013 - 02:49 PM
Wow, didn't know so many people will care about this…
How about SysRq button that will trigger "sysrq" event? It's like just what i said about terminate button, but terminate button is overpowered
I like this idea :)/>
Engineer #16
Posted 01 September 2013 - 02:57 PM
I like the idea well enough. But it's not hard to do this yourself in code as long as you're using an advanced computer. For that reason I could easily see one of the devs saying this idea's not gonna make it in.
Can you add GUI buttons with Lua code? Yes in the border, but if you see the image in the OP the buttons are outside the range of the screen where we as Lua programmers can reach.
ElvishJerricco #17
Posted 01 September 2013 - 05:01 PM
I like the idea well enough. But it's not hard to do this yourself in code as long as you're using an advanced computer. For that reason I could easily see one of the devs saying this idea's not gonna make it in.
Can you add GUI buttons with Lua code? Yes in the border, but if you see the image in the OP the buttons are outside the range of the screen where we as Lua programmers can reach.

Yea but that's a rather unimportant distinction. A button is a button whether it's on the screen or on the edge
Symmetryc #18
Posted 01 September 2013 - 05:11 PM
I feel as though something as fundamental as being able to shutdown your computer shouldn't be a button that you have to code in yourself…
ElvishJerricco #19
Posted 01 September 2013 - 05:20 PM
I feel as though something as fundamental as being able to shutdown your computer shouldn't be a button that you have to code in yourself…

Which is why the keyboard shortcuts exist. And don't get me wrong I'd like to have this included, but there's been countless suggestions denied because they could be easily programmed yourself. Obviously I can't know what the devs would say and I don't mean to speak for them. But if I were to guess based on past events, I'd say don't get your hopes up. Especially since the keyboard shortcuts are already good enough to function with.
Symmetryc #20
Posted 01 September 2013 - 05:27 PM
I feel as though something as fundamental as being able to shutdown your computer shouldn't be a button that you have to code in yourself…

Which is why the keyboard shortcuts exist. And don't get me wrong I'd like to have this included, but there's been countless suggestions denied because they could be easily programmed yourself. Obviously I can't know what the devs would say and I don't mean to speak for them. But if I were to guess based on past events, I'd say don't get your hopes up. Especially since the keyboard shortcuts are already good enough to function with.
I understand what you're saying and I see you're point, but I still think that clearly defined button trumps any keyboard shortcut that requires previous knowledge in order to operate.
nolongerexistant #21
Posted 01 September 2013 - 05:33 PM
This is the first suggestion I want to show my support for. These buttons (Or just a power button) would be a really nice addition. Especially if they are linked directly to the Java-side.
Lyqyd #22
Posted 01 September 2013 - 07:11 PM
We already have this in the form of Ctrl-R and Ctrl-S, just like the OP mentions. There's really no need for GUI additions. Keyboard shortcuts are easier than mouse buttons anyway.
Zudo #23
Posted 02 September 2013 - 02:14 AM
We already have this in the form of Ctrl-R and Ctrl-S, just like the OP mentions. There's really no need for GUI additions. Keyboard shortcuts are easier than mouse buttons anyway.

:(/> But we still should have System Request (IMO), that would be cool.

It adds for better compatibility, we can just say "click the button" instead of "press this button, unless you're in this locale, then press that one"

-snip-

I have had times where the shortcuts just weren't being detected and I had to try it multiple times, so I think buttons would work nicely!

And look at this!
Lyqyd #24
Posted 02 September 2013 - 02:52 AM
SysRq is not applicable to the ComputerCraft computers. Ctrl-R and Ctrl-S have never given me problems outside of very laggy servers, the sort where mouse buttons wouldn't be any better anyhow.
Egor305 #25
Posted 02 September 2013 - 05:34 AM
SysRq is not applicable to the ComputerCraft computers. Ctrl-R and Ctrl-S have never given me problems outside of very laggy servers, the sort where mouse buttons wouldn't be any better anyhow.
Yes? I'm actually have a reason for this.
So i did a program that switches in maintenance mode, when you hold Ctrl-T for 3 seconds. But I did it totally wrong: i used os.pullEventRaw = os.pullEvent. (oh and this program was /startup)
I did same OVER AND OVER LIKE 10 TIMES: put disk, reset, edit, take disk, reset, error, all from start.

IRL if my PC freezes, i use pen to press that little reset button. For somebody taking pen out of *nameOfThingWherePensAndPencilsStoredHere*, and pressing that button will take 3 seconds. I have pen ready for reseting PC any time, any moment. And some people have bigger reset buttons, so they can press it with finger! My 2nd PC had MS-DOS installed while ago. Oh… My… God… that was the most best reseting-PC experience ever! just Ctrl-Alt-Del and it reseted! Then i installed window 98 that glitched from everything. Guess what? Now i must press same combination 2 times! WTH? Even more happens when im install Windows XP - No. Shortcuts. At. All.

RESET, RESET, RESET, RESET, RE–
reset maniac mode off
So you get my point?
Now to SysRq. I'm not saying that real SysRq (aka PrtScr) key should be used as short cut. Instead it can be 3 second Ctrl-Button thing. And SysRq button on a side can be AdvComputer only, while other 2 buttons is for all Computers.

—EDIT—
I never use that pen for anything else. Only reseting.
Sebra #26
Posted 02 September 2013 - 10:04 AM
SysRq is not applicable to the ComputerCraft computers. Ctrl-R and Ctrl-S have never given me problems outside of very laggy servers, the sort where mouse buttons wouldn't be any better anyhow.
Yes. There is no hard need. But idea is still good.
"Hardware" Power & Reset is good style.
"System" or "SysRq" or any other name would be useful no doubts. (think about "Win" key and "how_it_is_on_mak")
The main question here is WOULD developers add it.
Egor305 #27
Posted 02 September 2013 - 12:59 PM
and "how_it_is_on_mak"
LOL. i call it like "keyHowItIsOnMac"
Zudo #28
Posted 02 September 2013 - 01:13 PM
I would use the SysRq button for screenshots :)/>
Lyqyd #29
Posted 02 September 2013 - 04:29 PM
There's no point to this. If they did add such buttons, they would do exactly the same thing as the keyboard shortcuts do. Locked.