Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - clear typeahead clear the keyboard buffer http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 clear typeahead     Clear the keyboard buffer
------------------------------------------------------------------------------
 Syntax
   clear typeahead

 Arguments
   None.

 Description
   The clear typeahead command clears the keyboard buffer.

   The Force runtime library maintains a keyboard buffer separate from other
   hardware buffers. The clear typeahead command clears both the BIOS and
   Force buffers.

   Use this command before waiting for important keyboard entries to avoid
   that any characters stuffed into the keyboard buffers cause unwanted
   results.

 Example
   #define EXAMPLE_IO
   #include example.hdr

   proc Test_cleartypeahead
   vardef
      uint n
      char c
   enddef
   ? "Keep pressing a key"
   waitms( 3000 )
   do while iskey()
      ? getkey()
   enddo
   ? "Type-ahead is cleared"
   clear typeahead
   do while iskey()
      ? getkey()
   enddo
   endproc

   proc main
   Test_cleartypeahead()
   endproc

See Also: getkey() keyint()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson