all repos — mgba @ 11354ac23ea6cbc41df04f2132e3b44d38c1494a

mGBA Game Boy Advance Emulator

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