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 - keyint() stuff the keyboard with key press http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 keyint()            Stuff the keyboard with key press
------------------------------------------------------------------------------
 Declaration
   io.hdr

 Syntax
   func logical keyint extern
   param value uint uKey

 Arguments
   uKey is the code of the key to put to the keyboard buffer.

 Return
   A logical indicating if the key could be stuffed into the keyboard buffer.
   In case of keyboard buffer overflow the return value is .f..

 Description
   The keyint() function places a keypress in the keyboard buffer.

 Example
   #define EXAMPLE_IO
   #include example.hdr

   proc SendKey
   param value uint uKey
   // Wait until the keyboard buffer has empty space to stuff a new character
   if .not. keyint( uKey )
      do while .not. keyint( uKey )
      enddo
   endif
   endpro
   
   proc Test_keyint
   SendKey( 'C' )          // send a C character
   ? chr( inkey() )        // print C
   endproc

   proc main
   Test_keyint()
   endproc

See Also: keyboard()

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