HDK
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
UI_DeviceEvent.h
Go to the documentation of this file.
1
#ifndef __UI_DeviceEvent__
2
#define __UI_DeviceEvent__
3
4
#include "
UI_API.h
"
5
6
#include <
RE/RE_IDType.h
>
7
#include <
SYS/SYS_Types.h
>
8
#include <
UT/UT_Array.h
>
9
#include <
UT/UT_StringHolder.h
>
10
11
#include "
UI_EventType.h
"
12
13
/*
14
* The UI_DeviceEvent is a generic event structure which
15
* various input device drivers will generate as sub-classes
16
* of UI_EventGenerator.
17
*/
18
19
/*
20
* Note: these are flag bits since more than one button can be down:
21
*/
22
#define UI_NO_BUTTON 0x0
23
#define UI_LEFT_BUTTON 0x01
24
#define UI_MIDDLE_BUTTON 0x02
25
#define UI_RIGHT_BUTTON 0x04
26
27
#define UI_ALT_KEY 0x001 //
28
#define UI_SHIFT_KEY 0x002 //
29
#define UI_CTRL_KEY 0x004 //
30
#define UI_COMMAND_KEY 0x008 // Windows key on Win/Linux
31
#define UI_META_KEYS (UI_ALT_KEY| \
32
UI_SHIFT_KEY| \
33
UI_CTRL_KEY| \
34
UI_COMMAND_KEY)
35
#define UI_ALPHASHIFT_KEY 0x010 // Caps-lock
36
#define UI_AUTOREPEAT 0x020 // Auto-repeat is on for the key
37
#define UI_IME_PREEDIT 0x040 // Key is IME pre-edit string
38
#define UI_IME_COMMIT 0x080 // Key is IME commit string
39
#define UI_KEYPAD_KEY 0x100 // The key came from the keypad
40
#define UI_TABLET_MOTION 0x200 // Motion event triggered from tablet.
41
42
// Conversion from our Z value to 0..1
43
#define UI_PRESSURE_SCALE 16384.0F
44
// Conversion of T/U/V values to degrees.
45
#define UI_ANGLE_SCALE 100.0F
46
47
enum
UI_ArrowKeys
48
{
49
UI_UP_ARROW
= 1,
50
UI_DOWN_ARROW
= 2,
51
UI_LEFT_ARROW
= 3,
52
UI_RIGHT_ARROW
= 4
53
};
54
55
enum
UI_Dimension
{
56
DEVICE_DIM_T
= 0,
57
DEVICE_DIM_U
= 1,
58
DEVICE_DIM_V
= 2,
59
W
= 3,
60
X
= 4,
61
Y
= 5,
62
Z
= 6
63
};
64
65
#define DIMENSIONS 7
66
67
68
class
UI_API
UI_DeviceEvent
69
{
70
public
:
71
UI_DeviceEvent
(
int
event_id = 0);
72
73
/// Returns an array of Unicode code points corresponding to typed in
74
/// characters from a keyboard event.
75
bool
getTypedCharacters(
UT_Array<utf32>
&cps)
const
;
76
77
UI_EventType
type
;
78
RE_IDType
context
;
// Device specific context
79
double
time
;
// Time in seconds.
80
81
exint
data
;
// Event data (at least pointer sized)
82
int
values
[
DIMENSIONS
];
// Usually valuator values
83
short
altFlags
;
// Event flags
84
short
id
;
// Event identifier
85
86
int
qt_key
;
87
UT_StringHolder
key
;
// Key input for UI_EVENT_KEYBOARD
88
};
89
90
inline
91
UI_DeviceEvent::UI_DeviceEvent
(
int
event_id)
92
{
93
id
= event_id;
94
95
type
=
UI_EVENT_NO_EVENT
;
96
97
context
= 0;
98
data
= 0;
99
altFlags
= 0;
100
values
[
DEVICE_DIM_T
] = 0;
101
values
[
DEVICE_DIM_U
] = 0;
102
values
[
DEVICE_DIM_V
] = 0;
103
values
[
W
] = 0;
104
values
[
X
] = 0;
105
values
[
Y
] = 0;
106
values
[
Z
] = 0;
107
108
time
= -1.0;
109
qt_key
= 0;
110
}
111
112
#endif
RE_IDType
void * RE_IDType
Definition:
RE_IDType.h:20
UI_DeviceEvent::data
exint data
Definition:
UI_DeviceEvent.h:81
UI_EVENT_NO_EVENT
Definition:
UI_EventType.h:22
RE_IDType.h
UI_DOWN_ARROW
Definition:
UI_DeviceEvent.h:50
UI_DeviceEvent::altFlags
short altFlags
Definition:
UI_DeviceEvent.h:83
UI_DeviceEvent::qt_key
int qt_key
Definition:
UI_DeviceEvent.h:86
HUSD_XformAxis::X
exint
int64 exint
Definition:
SYS_Types.h:125
UI_DeviceEvent::UI_DeviceEvent
UI_DeviceEvent(int event_id=0)
Definition:
UI_DeviceEvent.h:91
UI_DeviceEvent::key
UT_StringHolder key
Definition:
UI_DeviceEvent.h:87
UI_DeviceEvent::type
UI_EventType type
Definition:
UI_DeviceEvent.h:77
UT_Array.h
UI_ArrowKeys
UI_ArrowKeys
Definition:
UI_DeviceEvent.h:47
UT_Array
Definition:
BV_KDOPTree.h:18
UI_UP_ARROW
Definition:
UI_DeviceEvent.h:49
Y
Definition:
UI_DeviceEvent.h:61
values
GLenum GLsizei GLsizei GLint * values
Definition:
glcorearb.h:1602
Z
Definition:
UI_DeviceEvent.h:62
UT_StringHolder
Definition:
UT_StringHolder.h:1004
UI_EventType.h
SYS_Types.h
DEVICE_DIM_U
Definition:
UI_DeviceEvent.h:57
UI_DeviceEvent::context
RE_IDType context
Definition:
UI_DeviceEvent.h:78
DEVICE_DIM_T
Definition:
UI_DeviceEvent.h:56
UI_DeviceEvent::id
short id
Definition:
UI_DeviceEvent.h:84
X
Definition:
UI_DeviceEvent.h:60
UI_LEFT_ARROW
Definition:
UI_DeviceEvent.h:51
UI_Dimension
UI_Dimension
Definition:
UI_DeviceEvent.h:55
UI_EventType
UI_EventType
Definition:
UI_EventType.h:20
UI_RIGHT_ARROW
Definition:
UI_DeviceEvent.h:52
UI_DeviceEvent
Definition:
UI_DeviceEvent.h:68
HUSD_XformAxis::Y
UI_API.h
UT_StringHolder.h
UI_API
#define UI_API
Definition:
UI_API.h:10
DIMENSIONS
#define DIMENSIONS
Definition:
UI_DeviceEvent.h:65
type
type
Definition:
core.h:1059
DEVICE_DIM_V
Definition:
UI_DeviceEvent.h:58
UI_DeviceEvent::time
double time
Definition:
UI_DeviceEvent.h:79
data
Definition:
format.h:895
HUSD_XformAxis::Z
W
Definition:
UI_DeviceEvent.h:59
UI
UI_DeviceEvent.h
Generated on Wed Oct 4 2023 02:49:36 for HDK by
1.8.6