input_event.h
1 /*
2 ** UICore
3 ** Copyright (c) 1997-2015 The UICore Team
4 **
5 ** This software is provided 'as-is', without any express or implied
6 ** warranty. In no event will the authors be held liable for any damages
7 ** arising from the use of this software.
8 **
9 ** Permission is granted to anyone to use this software for any purpose,
10 ** including commercial applications, and to alter it and redistribute it
11 ** freely, subject to the following restrictions:
12 **
13 ** 1. The origin of this software must not be misrepresented; you must not
14 ** claim that you wrote the original software. If you use this software
15 ** in a product, an acknowledgment in the product documentation would be
16 ** appreciated but is not required.
17 ** 2. Altered source versions must be plainly marked as such, and must not be
18 ** misrepresented as being the original software.
19 ** 3. This notice may not be removed or altered from any source distribution.
20 **
21 ** Note: Some of the libraries UICore may link to may have additional
22 ** requirements or restrictions.
23 **
24 ** File Author(s):
25 **
26 ** Magnus Norddahl
27 ** Harry Storbacka
28 */
29 
30 #pragma once
31 
32 #include "input_device.h"
33 #include "keys.h"
34 #include "../../Core/Math/point.h"
35 
36 namespace uicore
37 {
39  class InputEvent
40  {
41  public:
43  enum Type
44  {
45  no_key = 0,
46  pressed = 1,
47  released = 2,
52  };
53 
56 
58  int id_offset = 0;
59 
67 
70 
73 
76 
79 
81  double axis_pos = 0.0;
82 
86  int repeat_count = 0;
87 
89  bool alt = false;
90  bool shift = false;
91  bool ctrl = false;
92  };
93 }
Type
Event types.
Definition: input_event.h:43
bool ctrl
Definition: input_event.h:91
Definition: input_event.h:49
bool shift
Definition: input_event.h:90
Definition: input_event.h:46
2D (x,y) point structure - Float
Definition: point.h:68
std::string str
Character sequence generated by event. A key press can generate one, none or multiple characters...
Definition: input_event.h:66
Definition: input_event.h:47
bool alt
State of modifier keys.
Definition: input_event.h:89
Definition: input_code.h:474
Type type
Event type.
Definition: input_event.h:69
2D (x,y) point structure - Integer
Definition: point.h:58
Definition: input_event.h:51
InputDevicePtr device
Device that event originates from.
Definition: input_event.h:72
Definition: input_event.h:50
Definition: input_event.h:48
InputCode
Definition: input_code.h:43
Pointf mouse_pos
Mouse position at event time.
Definition: input_event.h:75
double axis_pos
Axis position.
Definition: input_event.h:81
std::shared_ptr< InputDevice > InputDevicePtr
Definition: display_window.h:58
Input event class.
Definition: input_event.h:39
int id_offset
Contains the value (0 to x) for certains InputCode types that have a variable output identifier (for ...
Definition: input_event.h:58
int repeat_count
The repeat count for this event. Contains the number of times the keystroke has auto-repeated as a re...
Definition: input_event.h:86
Definition: Application/application.h:35
Definition: input_event.h:45
Point mouse_device_pos
Mouse actual position at event time.
Definition: input_event.h:78