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

Detecting keyboard input

Started by ShadeOfBlack, 01 October 2012 - 10:56 PM
ShadeOfBlack #1
Posted 02 October 2012 - 12:56 AM
Is there any way to detect when an arrow key is pressed like in the default "snake" game"?
I'm making a game in my minecraft world and I need this for keyboard controls.
Cranium #2
Posted 02 October 2012 - 12:57 AM
Th wiki is your friend. Also the tutorials section. You are looking for os.pullEvent() It has everything you need. Just search that on the wiki, and you'll get all you need.
MrBarry #3
Posted 04 October 2012 - 10:01 AM
You can also look at the source for snake itself. It's just a lua file.