diff options
| author | 2014-09-08 21:46:02 -0700 | |
|---|---|---|
| committer | 2014-09-12 01:15:14 -0700 | |
| commit | 02fd19b2f60f4db8a683734e4300d7498c861309 (patch) | |
| tree | c9c95671835d73b5ca7e52029de5bb27832e11a3 /src/common/emu_window.h | |
| parent | Initial HID PAD work, with GLFW only. (diff) | |
| download | yuzu-02fd19b2f60f4db8a683734e4300d7498c861309.tar.gz yuzu-02fd19b2f60f4db8a683734e4300d7498c861309.tar.xz yuzu-02fd19b2f60f4db8a683734e4300d7498c861309.zip | |
Added support for multiple input device types for KeyMap and connected Qt.
Diffstat (limited to 'src/common/emu_window.h')
| -rw-r--r-- | src/common/emu_window.h | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/src/common/emu_window.h b/src/common/emu_window.h index 90fbd9335..23f178fdf 100644 --- a/src/common/emu_window.h +++ b/src/common/emu_window.h | |||
| @@ -8,7 +8,6 @@ | |||
| 8 | #include "common/scm_rev.h" | 8 | #include "common/scm_rev.h" |
| 9 | 9 | ||
| 10 | #include "common/key_map.h" | 10 | #include "common/key_map.h" |
| 11 | #include "core/hle/service/hid.h" | ||
| 12 | 11 | ||
| 13 | // Abstraction class used to provide an interface between emulation code and the frontend (e.g. SDL, | 12 | // Abstraction class used to provide an interface between emulation code and the frontend (e.g. SDL, |
| 14 | // QGLWidget, GLFW, etc...) | 13 | // QGLWidget, GLFW, etc...) |
| @@ -35,21 +34,11 @@ public: | |||
| 35 | /// Releases (dunno if this is the "right" word) the GLFW context from the caller thread | 34 | /// Releases (dunno if this is the "right" word) the GLFW context from the caller thread |
| 36 | virtual void DoneCurrent() = 0; | 35 | virtual void DoneCurrent() = 0; |
| 37 | 36 | ||
| 38 | static void KeyPressed(KeyMap::CitraKey key) { | 37 | /// Signals a key press action to the HID module |
| 39 | HID_User::PADState mapped_key = KeyMap::Get3DSKey(key); | 38 | static void KeyPressed(KeyMap::HostDeviceKey key); |
| 40 | 39 | ||
| 41 | if (mapped_key.hex != HID_User::PAD_NONE.hex) { | 40 | /// Signals a key release action to the HID module |
| 42 | HID_User::PADButtonPress(mapped_key); | 41 | static void KeyReleased(KeyMap::HostDeviceKey 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 | 42 | ||
| 54 | Config GetConfig() const { | 43 | Config GetConfig() const { |
| 55 | return m_config; | 44 | return m_config; |