Start
Guides
Class List
Files
File List
All
Classes
Files
Functions
Variables
Typedefs
Pages
input
InputEvent.hpp
Go to the documentation of this file.
1
#pragma once
2
10
#include "
KeyCode.hpp
"
11
12
#include <cstdint>
13
#include <cstring>
14
15
namespace
lumina {
16
18
enum class
InputType : uint8_t {
19
KeyReleased,
20
KeyPressed,
21
KeyHold,
22
Char,
23
24
LMousePressed,
25
MMousePressed,
26
RMousePressed,
27
LMouseReleased,
28
MMouseReleased,
29
RMouseReleased,
30
MouseMoveDir,
31
MouseMovePos,
32
MouseScroll
33
};
34
36
struct
MouseInput
{
37
union
{
38
struct
{
39
float
x
;
40
float
y
;
41
};
42
struct
{
43
float
scrollX
;
44
float
scrollY
;
45
};
46
};
47
};
48
50
struct
KeyInput
{
51
KeyCode
key
;
52
unsigned
char
c
;
53
};
54
55
// input event
56
struct
InputEvent
{
57
InputType
type
;
58
59
union
{
60
KeyInput
keyInput
;
61
MouseInput
mouseInput
;
62
};
63
64
InputEvent
() {
65
memset(
this
, 0,
sizeof
(*
this
));
66
}
67
};
68
70
enum class
EventResult {
71
Skipped,
72
Processed
73
};
74
75
}
// namespace lumina
lumina::KeyInput::key
KeyCode key
Contains the KeyCode of the pressed/released key.
Definition:
InputEvent.hpp:51
lumina::InputEvent
Definition:
InputEvent.hpp:56
lumina::MouseInput::scrollX
float scrollX
Scroll delta (x)
Definition:
InputEvent.hpp:43
lumina::MouseInput::x
float x
Absolute position or delta of mouse movement (x axis)
Definition:
InputEvent.hpp:39
KeyCode.hpp
Provides enum class for all keys.
lumina::InputEvent::mouseInput
MouseInput mouseInput
Data for mouse input.
Definition:
InputEvent.hpp:61
lumina::MouseInput
Additional data about a mouse input.
Definition:
InputEvent.hpp:36
lumina::KeyInput
Additional data about a key input.
Definition:
InputEvent.hpp:50
lumina::MouseInput::scrollY
float scrollY
Scroll delta (y)
Definition:
InputEvent.hpp:44
lumina::KeyInput::c
unsigned char c
Contains the charachter of a charachter input.
Definition:
InputEvent.hpp:52
lumina::InputEvent::keyInput
KeyInput keyInput
Data for key input.
Definition:
InputEvent.hpp:60
lumina::InputEvent::type
InputType type
Type of the event.
Definition:
InputEvent.hpp:57
lumina::MouseInput::y
float y
Absolute position or delta of mouse movement (y axis)
Definition:
InputEvent.hpp:40
Last update on Wed Aug 13 2014 for Lumina v0.1