13 lines
342 B
C++
13 lines
342 B
C++
#include "Keyboard.h"
|
|
#include <conio.h>
|
|
|
|
Keyboard::Keyboard() {}
|
|
|
|
bool Keyboard::isCharAvail() {
|
|
// 'return kbhit()' is sufficient, but Microsoft
|
|
// issues a warning 'coercing int to bool' and encourages
|
|
// the use of '!=0' to eliminate it
|
|
return _kbhit() != 0;
|
|
}
|
|
|
|
char Keyboard::getChar() { return _getch(); } |