MAK RTIspy API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
simpleTimeKeyboard.h
Go to the documentation of this file.
1 /*******************************************************************************
2 * Adapted from "Beginning Linux Programming", from Wrox Press -- www.wrox.com
3 *******************************************************************************/
4 /*******************************************************************************
5 ** $RCSfile: simpleTimeKeyboard.h,v $ $Revision: 1.1 $ $State: Exp $
6 *******************************************************************************/
7 
8 // Utility to allow keyboard input without blocking
9 
10 #ifndef MYKBHIT_H_
11 #define MYKBHIT_H_
12 
13 #ifndef WIN32
14 #include <termios.h>
15 #endif
16 
17 class keyboard
18 {
19 public:
20 
21  keyboard();
22 
23  ~keyboard();
24 
25  // Returns 1 if keyboard input is ready; otherwise, 0
26  int kbhit();
27 
28  // Returns character from keyboard if avaialable; otherwise, 0
29  int keybrdTick();
30 
31 protected:
32 
33  // Return character from keyboard input
34  int getkey();
35 
36 private:
37 
38 #ifndef WIN32
39  struct termios initial_settings, new_settings;
40  int peek_character;
41 #endif
42 
43 };
44 
45 
46 #endif
47 

Document ID: Generated on Wed Mar 11 20:26:49 EDT 2015 from SVN revision 150939
Copyright © 2005-2015 VT MÄK Inc. All Rights Reserved (www.mak.com)