1 /*
2                                     __
3                                    / _|
4   __ _ _   _ _ __ ___  _ __ __ _  | |_ ___  ___ ___
5  / _` | | | | '__/ _ \| '__/ _` | |  _/ _ \/ __/ __|
6 | (_| | |_| | | | (_) | | | (_| | | || (_) \__ \__ \
7  \__,_|\__,_|_|  \___/|_|  \__,_| |_| \___/|___/___/
8 
9 Copyright (C) 2018-2019 Aurora Free Open Source Software.
10 
11 This file is part of the Aurora Free Open Source Software. This
12 organization promote free and open source software that you can
13 redistribute and/or modify under the terms of the GNU Lesser General
14 Public License Version 3 as published by the Free Software Foundation or
15 (at your option) any later version approved by the Aurora Free Open Source
16 Software Organization. The license is available in the package root path
17 as 'LICENSE' file. Please review the following information to ensure the
18 GNU Lesser General Public License version 3 requirements will be met:
19 https://www.gnu.org/licenses/lgpl.html .
20 
21 Alternatively, this file may be used under the terms of the GNU General
22 Public License version 3 or later as published by the Free Software
23 Foundation. Please review the following information to ensure the GNU
24 General Public License requirements will be met:
25 http://www.gnu.org/licenses/gpl-3.0.html.
26 
27 NOTE: All products, services or anything associated to trademarks and
28 service marks used or referenced on this file are the property of their
29 respective companies/owners or its subsidiaries. Other names and brands
30 may be claimed as the property of others.
31 
32 For more info about intellectual property visit: aurorafoss.org or
33 directly send an email to: contact (at) aurorafoss.org .
34 */
35 
36 module aurorafw.core.input.events;
37 
38 import aurorafw.core.input.keys;
39 
40 /**
41  * Keyboard Event
42  *
43  * This represents a keyboard event with keycode
44  * and input modifiers
45  *
46  * Examples:
47  * --------------------
48  * auto ke = KeyboardEvent(Keycode.A, InputModifier.Control | InputModifier.Alt);
49  * --------------------
50  */
51 struct KeyboardEvent
52 {
53 	Keycode key;
54 	InputModifier mods;
55 }
56 
57 /**
58  * Mouse Button Event
59  *
60  * This represents a mouse button event with
61  * button id and input modifiers
62  *
63  * Examples:
64  * --------------------
65  * auto mbe = MouseButtonEvent(InputButton.B1, InputModifier.None);
66  * --------------------
67  */
68 struct MouseButtonEvent
69 {
70 	InputButton btn;
71 	InputModifier mods;
72 }
73 
74 /**
75  * Mouse Motion Event
76  *
77  * This represents a mouse motion event with
78  * x and y position.
79  *
80  * Examples:
81  * --------------------
82  * auto mme = MouseMotionEvent(0.5, -0.4);
83  * --------------------
84  */
85 struct MouseMotionEvent
86 {
87 	double xpos, ypos;
88 }
89 
90 /**
91  * Mouse Scroll Event
92  *
93  * This represents a mouse scroll event with
94  * x and y position offset.
95  *
96  * Examples:
97  * --------------------
98  * auto mse = MouseScrollEvent(-1.0, 0);
99  * --------------------
100  */
101 struct MouseScrollEvent
102 {
103 	double xoffset, yoffset;
104 }
105 
106 /**
107  * Touch Finger Event
108  *
109  * This represents a touch finger event with,
110  * deslocated x and y, x and y position and
111  * finger ID
112  *
113  * Examples:
114  * --------------------
115  * auto tfe = TouchFingerEvent(1.0f, 1.0f, 0.5f, 0.4f, 1);
116  * --------------------
117  */
118 struct TouchFingerEvent
119 {
120 	float dx, dy;
121 	float x, y;
122 	ubyte fingerID;
123 }