all repos — mgba @ aff1486ec5fe3185de59d20665c4042b715853ae

mGBA Game Boy Advance Emulator

src/platform/qt/GamepadAxisEvent.h (view raw)

 1/* Copyright (c) 2013-2015 Jeffrey Pfau
 2 *
 3 * This Source Code Form is subject to the terms of the Mozilla Public
 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 6#ifndef QGBA_GAMEPAD_AXIS_EVENT
 7#define QGBA_GAMEPAD_AXIS_EVENT
 8
 9#include <QEvent>
10
11#include <mgba/internal/gba/input.h>
12
13namespace QGBA {
14
15class InputController;
16
17class GamepadAxisEvent : public QEvent {
18public:
19	enum Direction {
20		NEUTRAL = 0,
21		POSITIVE = 1,
22		NEGATIVE = -1
23	};
24
25	GamepadAxisEvent(int axis, Direction direction, bool isNew, int type, InputController* controller = nullptr);
26
27	int axis() const { return m_axis; }
28	Direction direction() const { return m_direction; }
29	bool isNew() const { return m_isNew; }
30	GBAKey gbaKey() const { return m_key; }
31
32	static enum Type Type();
33
34private:
35	static enum Type s_type;
36
37	int m_axis;
38	Direction m_direction;
39	bool m_isNew;
40	InputController* m_controller;
41	GBAKey m_key;
42};
43
44}
45
46#endif