src/platform/qt/GamepadButtonEvent.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_BUTTON_EVENT
7#define QGBA_GAMEPAD_BUTTON_EVENT
8
9#include <QEvent>
10
11extern "C" {
12#include "gba-input.h"
13}
14
15namespace QGBA {
16
17class InputController;
18
19class GamepadButtonEvent : public QEvent {
20public:
21 GamepadButtonEvent(Type type, int button, InputController* controller = nullptr);
22
23 int value() const { return m_button; }
24 GBAKey gbaKey() const { return m_key; }
25
26 static Type Down();
27 static Type Up();
28
29private:
30 static Type s_downType;
31 static Type s_upType;
32
33 int m_button;
34 InputController* m_controller;
35 GBAKey m_key;
36};
37
38}
39
40#endif