diff options
Diffstat (limited to 'src/common/emu_window.h')
| -rw-r--r-- | src/common/emu_window.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/common/emu_window.h b/src/common/emu_window.h index 5e2c33d7a..90fbd9335 100644 --- a/src/common/emu_window.h +++ b/src/common/emu_window.h | |||
| @@ -7,6 +7,9 @@ | |||
| 7 | #include "common/common.h" | 7 | #include "common/common.h" |
| 8 | #include "common/scm_rev.h" | 8 | #include "common/scm_rev.h" |
| 9 | 9 | ||
| 10 | #include "common/key_map.h" | ||
| 11 | #include "core/hle/service/hid.h" | ||
| 12 | |||
| 10 | // Abstraction class used to provide an interface between emulation code and the frontend (e.g. SDL, | 13 | // Abstraction class used to provide an interface between emulation code and the frontend (e.g. SDL, |
| 11 | // QGLWidget, GLFW, etc...) | 14 | // QGLWidget, GLFW, etc...) |
| 12 | class EmuWindow | 15 | class EmuWindow |
| @@ -32,6 +35,22 @@ public: | |||
| 32 | /// Releases (dunno if this is the "right" word) the GLFW context from the caller thread | 35 | /// Releases (dunno if this is the "right" word) the GLFW context from the caller thread |
| 33 | virtual void DoneCurrent() = 0; | 36 | virtual void DoneCurrent() = 0; |
| 34 | 37 | ||
| 38 | static void KeyPressed(KeyMap::CitraKey key) { | ||
| 39 | HID_User::PADState mapped_key = KeyMap::Get3DSKey(key); | ||
| 40 | |||
| 41 | if (mapped_key.hex != HID_User::PAD_NONE.hex) { | ||
| 42 | HID_User::PADButtonPress(mapped_key); | ||
| 43 | } | ||
| 44 | } | ||
| 45 | |||
| 46 | static void KeyReleased(KeyMap::CitraKey key) { | ||
| 47 | HID_User::PADState mapped_key = KeyMap::Get3DSKey(key); | ||
| 48 | |||
| 49 | if (mapped_key.hex != HID_User::PAD_NONE.hex) { | ||
| 50 | HID_User::PADButtonRelease(mapped_key); | ||
| 51 | } | ||
| 52 | } | ||
| 53 | |||
| 35 | Config GetConfig() const { | 54 | Config GetConfig() const { |
| 36 | return m_config; | 55 | return m_config; |
| 37 | } | 56 | } |