Computer Science Canada

Prevent Keyboard Input

Author:  AsianNinja [ Fri Jan 10, 2014 10:54 am ]
Post subject:  Prevent Keyboard Input

What is it you are trying to achieve?
Need to prevent keyboard input at certain points of my program


What is the problem you are having?
if i use getch, and someone types multiple letters, the program will then automatically enter the next few getch commands too


Describe what you have tried to solve this problem
not a lot, i cant think of a method at all


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
<Answer Here>

Turing:


<Add your code here>



Please specify what version of Turing you are using
4.1

Author:  Raknarg [ Fri Jan 10, 2014 10:56 am ]
Post subject:  RE:Prevent Keyboard Input

Turing:

loop
    if i_want_to_getch() then
        getch
    end if
end loop


Keep track of something to tell you whether or not you want to getch

Author:  AsianNinja [ Mon Jan 13, 2014 10:09 pm ]
Post subject:  Re: Prevent Keyboard Input

I dont think that works for me, thanks though
but is there any way to clear the queue/cache/buffer in turing?

Author:  Raknarg [ Mon Jan 13, 2014 10:12 pm ]
Post subject:  RE:Prevent Keyboard Input

Input.Flush I believe should work, but I'm not sure if it will work for getch as well.

Author:  Dreadnought [ Mon Jan 13, 2014 10:47 pm ]
Post subject:  Re: Prevent Keyboard Input

Raknarg wrote:

Input.Flush I believe should work, but I'm not sure if it will work for getch as well.

It certainly does Smile

Author:  AsianNinja [ Tue Jan 14, 2014 10:15 am ]
Post subject:  Re: Prevent Keyboard Input

Input. Flush works Very Happy
Thanks SO MUCH!!!


: