File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 9
9
static FVTerm* terminal;
10
10
11
11
// function prototype
12
- void keyPressed ();
12
+ bool keyPressed ();
13
13
void term_boundaries (int &, int &);
14
14
void move (int , int , int , int );
15
15
16
16
17
17
// ----------------------------------------------------------------------
18
18
// functions
19
19
// ----------------------------------------------------------------------
20
- void keyPressed ()
20
+ bool keyPressed ()
21
21
{
22
22
// Waiting for keypress
23
23
struct termios save, t;
24
+ bool ret;
24
25
std::cout << " \n Press any key to continue..." ;
25
26
fflush (stdout);
26
27
tcgetattr (STDIN_FILENO, &save);
27
28
t = save;
28
29
t.c_lflag &= uInt (~(ICANON | ECHO));
29
30
tcsetattr (STDIN_FILENO, TCSANOW, &t);
30
- getchar ();
31
+
32
+ if ( std::getchar () != EOF )
33
+ ret = true ;
34
+ else
35
+ ret = false ;
36
+
31
37
tcsetattr (STDIN_FILENO, TCSADRAIN, &save);
38
+ return ret;
32
39
}
33
40
34
41
// ----------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments