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

How to make 2 keys activate something when pressed at the same time?

Started by CitricThunder, 08 October 2012 - 10:04 PM
CitricThunder #1
Posted 09 October 2012 - 12:04 AM
Im trying to make a control panel which will open when you press CTRL ad ALT. I have tried if "key == 29 and 56 then" thinking it would work. Any ideas?
faubiguy #2
Posted 09 October 2012 - 12:17 AM
I don't think this is possible to do, because you can't tell when someone stops holding a key down.
Lyqyd #3
Posted 09 October 2012 - 02:10 AM
The best way to do this would be to start a very short timer (say, a tenth of a second or so) when either key is pressed. If the other key is pressed before the timer expires, you could consider them to have been pressed at the same time.