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

Getting multiple keypresses at once?

Started by tommykent1210, 03 August 2012 - 08:36 AM
tommykent1210 #1
Posted 03 August 2012 - 10:36 AM
For example, how would you get CTRL + T using os.pullEventRaw()?

I know you can get a single character pretty easily, but how would you get multiple key's at once? I want to allow the user to press CTRL+T/CTRL+S/CTRL+R but they will be prompted for a password first.


Thanks
Tom
BigSHinyToys #2
Posted 03 August 2012 - 10:41 AM
It is not currently possible to to to that.

how ever if you use os.pullEventRaw() it will return "terminate" when Ctrl+T is pressed.It is how it terminates actually

there is no way to detect or prevent Ctrl+S or Ctrl+R
tommykent1210 #3
Posted 03 August 2012 - 10:53 AM
really? How does the OS do it then? Because CTRL+R reboots, and CTRL+S issues the shutdown command :S
KaoS #4
Posted 03 August 2012 - 10:58 AM
It's in the Java of the cc mod
BigSHinyToys #5
Posted 03 August 2012 - 11:00 AM
Crtl+ R and Crtl + S are run from higher lever code in java They cause no even because the environment no longer exists after they are activated. Crtl+t is a event returned to os.pullEventRaw() that causes it to kill the running program while maintaining environment.

That is why People can make doors where Crtl+t don't work but know one can make a computer keep running after Crtl + R or Crtl + S is used.
Darky_Alan #6
Posted 03 August 2012 - 11:11 AM
More or less CTRL + R,S Are hard-coded into the mod and cannot be modified in-game.