Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Prevent Keyboard Input
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
AsianNinja




PostPosted: 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
Sponsor
Sponsor
Sponsor
sponsor
Raknarg




PostPosted: 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
AsianNinja




PostPosted: 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?
Raknarg




PostPosted: 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.
Dreadnought




PostPosted: 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
AsianNinja




PostPosted: Tue Jan 14, 2014 10:15 am   Post subject: Re: Prevent Keyboard Input

Input. Flush works Very Happy
Thanks SO MUCH!!!
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: