![]() |
MAK RTIspy API Documentation for HLA Evolved
|
00001 /******************************************************************************* 00002 * Adapted from "Beginning Linux Programming", from Wrox Press -- www.wrox.com 00003 *******************************************************************************/ 00004 00005 // Utility to allow keyboard input without blocking 00006 00007 #ifndef MYKBHIT_H_ 00008 #define MYKBHIT_H_ 00009 00010 #ifndef WIN32 00011 #include <termios.h> 00012 #endif 00013 00014 class keyboard 00015 { 00016 public: 00017 00018 keyboard(); 00019 00020 ~keyboard(); 00021 00022 // Returns 1 if keyboard input is ready; otherwise, 0 00023 int kbhit(); 00024 00025 // Returns character from keyboard if avaialable; otherwise, 0 00026 int keybrdTick(); 00027 00028 protected: 00029 00030 // Return character from keyboard input 00031 int getkey(); 00032 00033 private: 00034 00035 #ifndef WIN32 00036 struct termios initial_settings, new_settings; 00037 int peek_character; 00038 #endif 00039 00040 }; 00041 00042 00043 #endif 00044