diff options
| author | 2015-01-21 18:36:46 -0500 | |
|---|---|---|
| committer | 2015-01-21 18:36:46 -0500 | |
| commit | 0c7498545f7f9beeb7e8070e1a1955a8d6f40bb6 (patch) | |
| tree | 9eaedc4e6d764f3436a45ba05e79f16fec1ff299 /src/common | |
| parent | Merge pull request #429 from Kingcom/titlebar (diff) | |
| parent | Added HID_SPVR service and split HID_U implementation into service/hid/hid.xxx (diff) | |
| download | yuzu-0c7498545f7f9beeb7e8070e1a1955a8d6f40bb6.tar.gz yuzu-0c7498545f7f9beeb7e8070e1a1955a8d6f40bb6.tar.xz yuzu-0c7498545f7f9beeb7e8070e1a1955a8d6f40bb6.zip | |
Merge pull request #491 from archshift/hidspvr
Added HID_SPVR service and split HID_U implementation into hle/service/hid/hid.xxx
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/emu_window.cpp | 8 | ||||
| -rw-r--r-- | src/common/key_map.cpp | 6 | ||||
| -rw-r--r-- | src/common/key_map.h | 6 |
3 files changed, 10 insertions, 10 deletions
diff --git a/src/common/emu_window.cpp b/src/common/emu_window.cpp index 4ec7b263a..48bb35db5 100644 --- a/src/common/emu_window.cpp +++ b/src/common/emu_window.cpp | |||
| @@ -5,13 +5,13 @@ | |||
| 5 | #include "emu_window.h" | 5 | #include "emu_window.h" |
| 6 | 6 | ||
| 7 | void EmuWindow::KeyPressed(KeyMap::HostDeviceKey key) { | 7 | void EmuWindow::KeyPressed(KeyMap::HostDeviceKey key) { |
| 8 | HID_User::PadState mapped_key = KeyMap::GetPadKey(key); | 8 | Service::HID::PadState mapped_key = KeyMap::GetPadKey(key); |
| 9 | 9 | ||
| 10 | HID_User::PadButtonPress(mapped_key); | 10 | Service::HID::PadButtonPress(mapped_key); |
| 11 | } | 11 | } |
| 12 | 12 | ||
| 13 | void EmuWindow::KeyReleased(KeyMap::HostDeviceKey key) { | 13 | void EmuWindow::KeyReleased(KeyMap::HostDeviceKey key) { |
| 14 | HID_User::PadState mapped_key = KeyMap::GetPadKey(key); | 14 | Service::HID::PadState mapped_key = KeyMap::GetPadKey(key); |
| 15 | 15 | ||
| 16 | HID_User::PadButtonRelease(mapped_key); | 16 | Service::HID::PadButtonRelease(mapped_key); |
| 17 | } | 17 | } |
diff --git a/src/common/key_map.cpp b/src/common/key_map.cpp index d8945bb13..844d5df68 100644 --- a/src/common/key_map.cpp +++ b/src/common/key_map.cpp | |||
| @@ -7,18 +7,18 @@ | |||
| 7 | 7 | ||
| 8 | namespace KeyMap { | 8 | namespace KeyMap { |
| 9 | 9 | ||
| 10 | static std::map<HostDeviceKey, HID_User::PadState> key_map; | 10 | static std::map<HostDeviceKey, Service::HID::PadState> key_map; |
| 11 | static int next_device_id = 0; | 11 | static int next_device_id = 0; |
| 12 | 12 | ||
| 13 | int NewDeviceId() { | 13 | int NewDeviceId() { |
| 14 | return next_device_id++; | 14 | return next_device_id++; |
| 15 | } | 15 | } |
| 16 | 16 | ||
| 17 | void SetKeyMapping(HostDeviceKey key, HID_User::PadState padState) { | 17 | void SetKeyMapping(HostDeviceKey key, Service::HID::PadState padState) { |
| 18 | key_map[key].hex = padState.hex; | 18 | key_map[key].hex = padState.hex; |
| 19 | } | 19 | } |
| 20 | 20 | ||
| 21 | HID_User::PadState GetPadKey(HostDeviceKey key) { | 21 | Service::HID::PadState GetPadKey(HostDeviceKey key) { |
| 22 | return key_map[key]; | 22 | return key_map[key]; |
| 23 | } | 23 | } |
| 24 | 24 | ||
diff --git a/src/common/key_map.h b/src/common/key_map.h index 8d949b852..0ecec714f 100644 --- a/src/common/key_map.h +++ b/src/common/key_map.h | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include "core/hle/service/hid_user.h" | 7 | #include "core/hle/service/hid/hid.h" |
| 8 | 8 | ||
| 9 | namespace KeyMap { | 9 | namespace KeyMap { |
| 10 | 10 | ||
| @@ -35,11 +35,11 @@ int NewDeviceId(); | |||
| 35 | /** | 35 | /** |
| 36 | * Maps a device-specific key to a PadState. | 36 | * Maps a device-specific key to a PadState. |
| 37 | */ | 37 | */ |
| 38 | void SetKeyMapping(HostDeviceKey key, HID_User::PadState padState); | 38 | void SetKeyMapping(HostDeviceKey key, Service::HID::PadState padState); |
| 39 | 39 | ||
| 40 | /** | 40 | /** |
| 41 | * Gets the PadState that's mapped to the provided device-specific key. | 41 | * Gets the PadState that's mapped to the provided device-specific key. |
| 42 | */ | 42 | */ |
| 43 | HID_User::PadState GetPadKey(HostDeviceKey key); | 43 | Service::HID::PadState GetPadKey(HostDeviceKey key); |
| 44 | 44 | ||
| 45 | } | 45 | } |