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