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

Detecting user key input for certain amount of time

Started by laica10, 06 May 2015 - 01:19 PM
laica10 #1
Posted 06 May 2015 - 03:19 PM
Hey,

I got a question again i am trying to detect a key input but,
the first second the function runs it has to detect for the key
input after that 1 second the program has to run an
another function.

Is this possible?

-Laica10
Lyqyd #2
Posted 06 May 2015 - 03:27 PM
Yep. Just start a one-second timer and then wait for an event with os.pullEvent and look for timer and char (or key) events.
laica10 #3
Posted 06 May 2015 - 03:33 PM
Yep. Just start a one-second timer and then wait for an event with os.pullEvent and look for timer and char (or key) events.
Yea I'll try it in a sec
laica10 #4
Posted 06 May 2015 - 03:45 PM
Yep. Just start a one-second timer and then wait for an event with os.pullEvent and look for timer and char (or key) events.
Thank's man it worked