MAK RTIspy API Documentation for HLA 1.3
Home
Modules
Namespaces
Classes
Files
Examples
Libraries
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
examples
simpleDDM
simpleDDMKeyboard.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: simpleDDMKeyboard.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
// Special Extended Key Definitions
22
enum
23
{
24
#ifdef WIN32
25
upKey
=
'\110'
,
26
downKey
=
'\120'
,
27
leftKey
=
'\113'
,
28
rightKey
=
'\115'
29
#else
30
// Fix incorrect keybindings in *nix.
31
// we're still using the keypad.
32
upKey
=
'A'
,
33
downKey
=
'B'
,
34
leftKey
=
'D'
,
35
rightKey
=
'C'
36
#endif
37
};
38
39
keyboard
();
40
41
~keyboard
();
42
43
// Returns 1 if keyboard input is ready; otherwise, 0
44
int
kbhit
();
45
46
// Returns character from keyboard if avaialable; otherwise, 0
47
int
keybrdTick
();
48
49
protected
:
50
51
// Return character from keyboard input
52
int
getkey
();
53
54
private
:
55
56
#ifndef WIN32
57
struct
termios initial_settings,
new_settings
;
58
int
peek_character
;
59
#endif
60
61
};
62
63
64
#endif
65
Document ID: Generated on Mon Mar 21 09:41:37 EDT 2016 from SVN revision 163228
Copyright © 2005-2015 VT MÄK Inc. All Rights Reserved (
www.mak.com
)