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