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

[1.6] fg and bg improvements

Started by apemanzilla, 28 March 2014 - 06:04 PM
apemanzilla #1
Posted 28 March 2014 - 07:04 PM
Two simple suggestions with the new shell system:
  • Dragging the bars for programs to rearrange them
  • Ctrl + right/left arrow to switch right or left a tab
  • Right click a bar for a program to close it (Remove the coroutine)
Just would make it easier to use :)/>
Edited on 31 March 2014 - 04:55 PM
awsmazinggenius #2
Posted 29 March 2014 - 03:32 AM
I personally would like to be able to swipe down (there isn't anything to swipe to if you swipe up) the bar to kill the program's coroutine.
oeed #3
Posted 29 March 2014 - 07:28 AM
I agree with right clicking to closing, it's a bit of a pain having to hold down Ctrl + T.
Katorone #4
Posted 31 March 2014 - 11:11 AM
What's wrong with typing "exit" to close a tab?

Personally, I'd love to have built-in hotkeys to switch to tabs. For instance ctrl+arrow to switch to the tab left or right.
Jarle212 #5
Posted 31 March 2014 - 04:03 PM
What's wrong with typing "exit" to close a tab?

Personally, I'd love to have built-in hotkeys to switch to tabs. For instance ctrl+arrow to switch to the tab left or right.
Exit dosn't work for all programs :/
The tab only closes when the program decides to do so atm. Would be nice to be able to terminate the "thread" from outside the program
TheOddByte #6
Posted 31 March 2014 - 06:12 PM
What's wrong with typing "exit" to close a tab?

Personally, I'd love to have built-in hotkeys to switch to tabs. For instance ctrl+arrow to switch to the tab left or right.
That only works for the shell( and other programs, IF they have programmed it to terminate when 'exit' is typed )
But the CTRL+Arrow idea sounded cool, But as the OP suggested I would like to have the ability to drag the tabs.
apemanzilla #7
Posted 31 March 2014 - 06:55 PM
Updated OP with ctrl + arrow suggestion
Jarle212 #8
Posted 31 March 2014 - 08:02 PM
Updated OP with ctrl + arrow suggestion
That would be buggy cause you can't detect button release, only button press. Unless he makes it so that the ctrl would be toggled, but again that would render the ctrl key useless in other programs
Edited on 31 March 2014 - 06:04 PM
apemanzilla #9
Posted 31 March 2014 - 10:40 PM
Updated OP with ctrl + arrow suggestion
That would be buggy cause you can't detect button release, only button press. Unless he makes it so that the ctrl would be toggled, but again that would render the ctrl key useless in other programs
….

You realize that holding a key down sends constant key events, right?

Right?
Jarle212 #10
Posted 31 March 2014 - 10:50 PM
Updated OP with ctrl + arrow suggestion
That would be buggy cause you can't detect button release, only button press. Unless he makes it so that the ctrl would be toggled, but again that would render the ctrl key useless in other programs
….

You realize that holding a key down sends constant key events, right?

Right?
Yes, but thos key events sometimes get lost and are not a good way of recording what keys that are beeing held down, and it only works for one key at a time, when another key is held down the key event for that key gets spammed the other one gets lost
Edited on 31 March 2014 - 08:53 PM
awsmazinggenius #11
Posted 01 April 2014 - 02:16 AM
I think CC spams events for both keys if you hold down more than one.
Jarle212 #12
Posted 01 April 2014 - 06:35 AM
I think CC spams events for both keys if you hold down more than one.
O.o
Nope, dosn't do that. It is the keyboard that stops the spamming of the other keys, cause it only send type-events for one key at the time.

Edit:
So unless keyPressed and keyReleased events are added(unlikely) that would be buggy(not impossible tho)
Edited on 01 April 2014 - 04:37 AM
wieselkatze #13
Posted 01 April 2014 - 11:44 AM
Nah, I don't think so.
You could just start a timer when the Ctrl key ist pressed and assign it to a variable. The timer (os.startTimer()) os just a short timer (~0.05s) and the variable will be set to nil if that timer is fired.
So if you press your second key the program will just check if the variable is nil, if not, your code will be executed.

Something like that should work.
Jarle212 #14
Posted 01 April 2014 - 11:53 AM
Nah, I don't think so.
You could just start a timer when the Ctrl key ist pressed and assign it to a variable. The timer (os.startTimer()) os just a short timer (~0.05s) and the variable will be set to nil if that timer is fired.
So if you press your second key the program will just check if the variable is nil, if not, your code will be executed.

Something like that should work.

Yes, but then you can't go forth and back between the tabs.
Lets say you hold ctrl then press the left key, after that you won't be able to press the right arrow to go back.
Edited on 01 April 2014 - 09:54 AM
apemanzilla #15
Posted 01 April 2014 - 01:01 PM
Nah, I don't think so.
You could just start a timer when the Ctrl key ist pressed and assign it to a variable. The timer (os.startTimer()) os just a short timer (~0.05s) and the variable will be set to nil if that timer is fired.
So if you press your second key the program will just check if the variable is nil, if not, your code will be executed.

Something like that should work.

Yes, but then you can't go forth and back between the tabs.
Lets say you hold ctrl then press the left key, after that you won't be able to press the right arrow to go back.
>facedesk<

Ok. Every time you hold the control key down, it spams "key" events. You then check for two key events, for the control key and right key, in close proximity. Then you switch tabs. If there's a control event and a left arrow key event in close proximity, switch left a tab. It's not really that hard.
Jarle212 #16
Posted 01 April 2014 - 01:25 PM
Nah, I don't think so.
You could just start a timer when the Ctrl key ist pressed and assign it to a variable. The timer (os.startTimer()) os just a short timer (~0.05s) and the variable will be set to nil if that timer is fired.
So if you press your second key the program will just check if the variable is nil, if not, your code will be executed.

Something like that should work.

Yes, but then you can't go forth and back between the tabs.
Lets say you hold ctrl then press the left key, after that you won't be able to press the right arrow to go back.
>facedesk<

Ok. Every time you hold the control key down, it spams "key" events. You then check for two key events, for the control key and right key, in close proximity. Then you switch tabs. If there's a control event and a left arrow key event in close proximity, switch left a tab. It's not really that hard.
Yes, but that only works once. After pressing another button you wont get any more events for the control key, which would be anoying :P/>
Sorry if I didn't make that clear in my earlier post
Edited on 01 April 2014 - 11:27 AM
apemanzilla #17
Posted 01 April 2014 - 01:45 PM
Nah, I don't think so.
You could just start a timer when the Ctrl key ist pressed and assign it to a variable. The timer (os.startTimer()) os just a short timer (~0.05s) and the variable will be set to nil if that timer is fired.
So if you press your second key the program will just check if the variable is nil, if not, your code will be executed.

Something like that should work.

Yes, but then you can't go forth and back between the tabs.
Lets say you hold ctrl then press the left key, after that you won't be able to press the right arrow to go back.
>facedesk<

Ok. Every time you hold the control key down, it spams "key" events. You then check for two key events, for the control key and right key, in close proximity. Then you switch tabs. If there's a control event and a left arrow key event in close proximity, switch left a tab. It's not really that hard.
Yes, but that only works once. After pressing another button you wont get any more events for the control key, which would be anoying :P/>
Sorry if I didn't make that clear in my earlier post
You don't need more control key events. You assume the button is pressed as long as they keep pressing right or left in quick proximity, then after a second or two of unrelated events assume the control key has been released.
Bomb Bloke #18
Posted 01 April 2014 - 01:52 PM
Just throwing out my opinion, but I, for one, would find sort of implementation more than a tad annoying. I'd keep letting go of Ctrl after a switch, pushing arrow keys to interact with whatever script I'd switched to, then swearing as Multishell decided to switch tabs again.

It beats me why there aren't release events. I assume they're very hard to capture… for whatever reason… but they'd be very nice to have.
Jarle212 #19
Posted 01 April 2014 - 02:32 PM
Just throwing out my opinion, but I, for one, would find sort of implementation more than a tad annoying. I'd keep letting go of Ctrl after a switch, pushing arrow keys to interact with whatever script I'd switched to, then swearing as Multishell decided to switch tabs again.

It beats me why there aren't release events. I assume they're very hard to capture… for whatever reason… but they'd be very nice to have.

Not shure how minecraft handles key inputs, but shouldn't be too hard.

-snip-

That would be hard to get used to.
What he could implement is that you press ctrl or alt to toggle the shell into/outof a tab switching mode.
Edited on 01 April 2014 - 12:34 PM
electrodude512 #20
Posted 14 April 2014 - 05:24 AM
The keyboard shortcut coroutine from LuaIDE works perfectly for me. Just use that.