chore: Add course material
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
#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(); }
|
||||
Reference in New Issue
Block a user