input_event.h
1 /*
2 ** ClanLib SDK
3 ** Copyright (c) 1997-2013 The ClanLib 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 ClanLib 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 
31 #pragma once
32 
33 #include "../api_display.h"
34 #include "input_device.h"
35 #include "keys.h"
36 #include "../../Core/Math/point.h"
37 
38 namespace clan
39 {
42 
44 class CL_API_DISPLAY InputEvent
45 {
46 public:
48  enum Type
49  {
50  no_key = 0,
51  pressed = 1,
52  released = 2,
53  doubleclick = 3,
54  pointer_moved = 4,
55  axis_moved = 5,
56  proximity_change = 6
57  };
58 
61 
62 public:
64  InputEvent();
65 
66  ~InputEvent();
67 
71 
72 public:
73 
77 
78 public:
81 
83  int id_offset;
84 
86 
91  std::string str;
92 
95 
98 
101 
103  double axis_pos;
104 
106 
109 
111  bool alt;
112  bool shift;
113  bool ctrl;
114 
118 
119 private:
120 
122 };
123 
124 }
125 
int repeat_count
The repeat count for this event.
Definition: input_event.h:108
Point mouse_pos
Mouse position at event time.
Definition: input_event.h:100
Type
Event types.
Definition: input_event.h:48
std::string str
Character sequence generated by event.
Definition: input_event.h:91
InputCode id
The exact input.
Definition: input_event.h:80
bool ctrl
Definition: input_event.h:113
InputDevice.
Definition: input_device.h:48
double axis_pos
Axis position.
Definition: input_event.h:103
int id_offset
Contains the value (0 to x) for certains InputCode types that have a variable output identifier (for ...
Definition: input_event.h:83
InputCode
Definition: keys.h:42
Type type
Event type.
Definition: input_event.h:94
2D (x,y) point structure - Integer
Definition: point.h:63
InputDevice device
Device that event originates from.
Definition: input_event.h:97
Input event class.
Definition: input_event.h:44
bool shift
Definition: input_event.h:112
bool alt
State of modifier keys.
Definition: input_event.h:111