FreeBASIC
0.91.0
Main Page
Data Structures
Files
File List
Globals
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
7
FBSTRING
*
fb_ConsoleInkey
(
void
)
8
{
9
FBSTRING
*res;
10
11
if
(
fb_ConsoleKeyHit
( ) ) {
12
res =
fb_hMakeInkeyStr
(
fb_ConsoleGetkey
( ) );
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. */
30
fb_hConsoleInputBufferChanged
( );
31
32
return
k;
33
}
34
35
int
fb_ConsoleKeyHit
(
void
)
36
{
37
return
_conio_kbhit( );
38
}
rtlib
dos
io_inkey.c
Generated on Thu Jan 23 2014 19:40:09 for FreeBASIC by
1.8.4