MAK RTIspy API Documentation for HLA 1.3
Home
Modules
Namespaces
Classes
Files
Examples
Libraries
File List
File Members
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 Tue May 7 16:26:47 EDT 2013 from SVN revision 126903
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (
www.mak.com
)