1 module aurorafw.core.inputlistener;
2 
3 /****************************************************************************
4 ** ┌─┐┬ ┬┬─┐┌─┐┬─┐┌─┐  ┌─┐┬─┐┌─┐┌┬┐┌─┐┬ ┬┌─┐┬─┐┬┌─
5 ** ├─┤│ │├┬┘│ │├┬┘├─┤  ├┤ ├┬┘├─┤│││├┤ ││││ │├┬┘├┴┐
6 ** ┴ ┴└─┘┴└─└─┘┴└─┴ ┴  └  ┴└─┴ ┴┴ ┴└─┘└┴┘└─┘┴└─┴ ┴
7 ** A Powerful General Purpose Framework
8 ** More information in: https://aurora-fw.github.io/
9 **
10 ** Copyright (C) 2018 Aurora Framework, All rights reserved.
11 **
12 ** This file is part of the Aurora Framework. This framework is free
13 ** software; you can redistribute it and/or modify it under the terms of
14 ** the GNU Lesser General Public License version 3 as published by the
15 ** Free Software Foundation and appearing in the file LICENSE included in
16 ** the packaging of this file. Please review the following information to
17 ** ensure the GNU Lesser General Public License version 3 requirements
18 ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
19 ****************************************************************************/
20 
21 pure @safe abstract class InputListener {
22 	struct KeyboardEvent {
23 		int key, scancode;
24 		ushort mods;
25 	}
26 
27 	struct MouseButtonEvent {
28 		int btn;
29 		ushort mods;
30 	}
31 
32 	struct MouseMotionEvent {
33 		double xpos, ypos;
34 	}
35 
36 	struct MouseScrollEvent {
37 		double xoffset, yoffset;
38 	}
39 
40 	~this() {}
41 
42 	bool keyPressed(immutable ref KeyboardEvent )
43 	{ return true; }
44 
45 	bool keyReleased(immutable ref KeyboardEvent )
46 	{ return true; }
47 
48 	bool mousePressed(immutable ref MouseButtonEvent )
49 	{ return true; }
50 
51 	bool mouseReleased(immutable ref MouseButtonEvent )
52 	{ return true; }
53 
54 	bool mouseMoved(immutable ref MouseMotionEvent )
55 	{ return true; }
56 
57 	bool mouseScrolled(immutable ref MouseScrollEvent )
58 	{ return true; }
59 }