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
12namespace QGBA {
13
14class ConfigController;
15
16class InputController {
17public:
18 static const uint32_t KEYBOARD = 0x51545F4B;
19
20 InputController();
21 ~InputController();
22
23 void setConfiguration(ConfigController* config);
24 void loadConfiguration(uint32_t type);
25 void saveConfiguration(uint32_t type = KEYBOARD);
26
27 GBAKey mapKeyboard(int key) const;
28
29 void bindKey(uint32_t type, int key, GBAKey);
30
31 const GBAInputMap* map() const { return &m_inputMap; }
32
33#ifdef BUILD_SDL
34 int testSDLEvents();
35#endif
36
37private:
38 GBAInputMap m_inputMap;
39 ConfigController* m_config;
40
41#ifdef BUILD_SDL
42 GBASDLEvents m_sdlEvents;
43#endif
44};
45
46}
47
48#endif