MAK RTIspy API Documentation for HLA Evolved
 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 
int getkey()
int kbhit()
Definition: rtiSimpleKeyboard.h:14
struct termios initial_settings new_settings
Definition: rtiSimpleKeyboard.h:36
int peek_character
Definition: rtiSimpleKeyboard.h:37
int keybrdTick()

Document ID: Generated on Thu May 11 15:55:32 EDT 2023 from SVN revision 254743
Copyright © 2005-2020 MAK Technologies Inc. All Rights Reserved (www.mak.com)