FreeBASIC  0.91.0
io_inkey.c
Go to the documentation of this file.
1 /* console INKEY() function */
2 
3 #include "../fb.h"
4 #include "fb_private_console.h"
5 #include <conio.h>
6 
8 {
9  FBSTRING *res;
10 
11  if( fb_ConsoleKeyHit( ) ) {
13  } else {
14  res = &__fb_ctx.null_desc;
15  }
16 
17  return res;
18 }
19 
20 int fb_ConsoleGetkey( void )
21 {
22  unsigned int k;
23 
24  k = (unsigned int)getch( );
25  if( k == 0x00 || k == 0xE0 )
26  k = FB_MAKE_EXT_KEY( (unsigned int)getch( ) );
27 
28  /* Reset the status for "key buffer changed" when a key
29  * was removed from the input queue. */
31 
32  return k;
33 }
34 
35 int fb_ConsoleKeyHit( void )
36 {
37  return _conio_kbhit( );
38 }