summaryrefslogtreecommitdiffstats
path: root/src/common/event.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/event.h')
-rw-r--r--src/common/event.h26
1 files changed, 18 insertions, 8 deletions
diff --git a/src/common/event.h b/src/common/event.h
index 4df1e6d..73950af 100644
--- a/src/common/event.h
+++ b/src/common/event.h
@@ -44,7 +44,9 @@ struct KeyEventData
{
//! STATE_PRESSED or STATE_RELEASED */
PressState state;
- //! Key symbol: KEY(...) macro value (from common/key.h)
+ //! If true, the key is a virtual code generated by key modifier press or joystick button press
+ bool virt;
+ //! Key symbol: KEY(...) macro value or virtual key VIRTUAL_... (from common/key.h)
unsigned int key;
//! Keyboard modifiers: a bitmask made of KEY_MOD(...) macro values (from common/key.h)
unsigned int mod;
@@ -52,7 +54,7 @@ struct KeyEventData
unsigned int unicode;
KeyEventData()
- : state(STATE_PRESSED), key(0), mod(0), unicode(0) {}
+ : state(STATE_PRESSED), virt(false), key(0), mod(0), unicode(0) {}
};
/** \struct MouseMotionEventData
@@ -60,7 +62,7 @@ struct KeyEventData
struct MouseMoveEventData
{
//! Current button state
- unsigned char state;
+ PressState state;
//! Position of mouse in normalized coordinates (0..1)
Math::Point pos;
@@ -171,17 +173,25 @@ struct Event
ActiveEventData active;
};
+ //! State of tracked keys (mask of TrackedKey enum values)
+ unsigned int trackedKeys;
+
+ //! Mouse position is provided also for other types of events besides mouse events
+ Math::Point mousePos;
+
+ // TODO: remove and replace references with trackedKeys
+ short keyState;
+
+ // TODO: remove and replace references with mousePos
+ Math::Point pos;
+
// TODO: remove
long param; // parameter
- // TODO: remove?
- Math::Point pos; // mouse position (0 .. 1)
-
// TODO: ?
float axeX; // control the X axis (-1 .. 1)
float axeY; // control of the Y axis (-1 .. 1)
float axeZ; // control the Z axis (-1 .. 1)
- short keyState; // state of the keyboard (KS_ *)
// TODO: remove in longer term (use CApplication's new time functions instead)
float rTime; // relative time
@@ -190,10 +200,10 @@ struct Event
{
type = aType;
systemEvent = false;
+ trackedKeys = 0;
param = 0;
axeX = axeY = axeZ = 0.0f;
- keyState = 0;
rTime = 0.0f;
}
};