all repos — mgba @ e6ea94d2296eae963a48a18d009217a38d92bf9b

mGBA Game Boy Advance Emulator

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

 1#ifndef QGBA_INPUT_CONTROLLER_H
 2#define QGBA_INPUT_CONTROLLER_H
 3
 4extern "C" {
 5#include "gba-input.h"
 6
 7#ifdef BUILD_SDL
 8#include "platform/sdl/sdl-events.h"
 9#endif
10}
11
12#include <QSet>
13
14namespace QGBA {
15
16class ConfigController;
17
18class InputController {
19public:
20	static const uint32_t KEYBOARD = 0x51545F4B;
21
22	InputController();
23	~InputController();
24
25	void setConfiguration(ConfigController* config);
26	void loadConfiguration(uint32_t type);
27	void saveConfiguration(uint32_t type = KEYBOARD);
28
29	GBAKey mapKeyboard(int key) const;
30
31	void bindKey(uint32_t type, int key, GBAKey);
32
33	const GBAInputMap* map() const { return &m_inputMap; }
34
35#ifdef BUILD_SDL
36	int testSDLEvents();
37	QSet<int> activeGamepadButtons();
38#endif
39
40private:
41	GBAInputMap m_inputMap;
42	ConfigController* m_config;
43
44#ifdef BUILD_SDL
45	GBASDLEvents m_sdlEvents;
46#endif
47};
48
49}
50
51#endif