summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorGravatar bunnei2015-01-21 18:36:46 -0500
committerGravatar bunnei2015-01-21 18:36:46 -0500
commit0c7498545f7f9beeb7e8070e1a1955a8d6f40bb6 (patch)
tree9eaedc4e6d764f3436a45ba05e79f16fec1ff299 /src/common
parentMerge pull request #429 from Kingcom/titlebar (diff)
parentAdded HID_SPVR service and split HID_U implementation into service/hid/hid.xxx (diff)
downloadyuzu-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.cpp8
-rw-r--r--src/common/key_map.cpp6
-rw-r--r--src/common/key_map.h6
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
7void EmuWindow::KeyPressed(KeyMap::HostDeviceKey key) { 7void 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
13void EmuWindow::KeyReleased(KeyMap::HostDeviceKey key) { 13void 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
8namespace KeyMap { 8namespace KeyMap {
9 9
10static std::map<HostDeviceKey, HID_User::PadState> key_map; 10static std::map<HostDeviceKey, Service::HID::PadState> key_map;
11static int next_device_id = 0; 11static int next_device_id = 0;
12 12
13int NewDeviceId() { 13int NewDeviceId() {
14 return next_device_id++; 14 return next_device_id++;
15} 15}
16 16
17void SetKeyMapping(HostDeviceKey key, HID_User::PadState padState) { 17void 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
21HID_User::PadState GetPadKey(HostDeviceKey key) { 21Service::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
9namespace KeyMap { 9namespace 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 */
38void SetKeyMapping(HostDeviceKey key, HID_User::PadState padState); 38void 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 */
43HID_User::PadState GetPadKey(HostDeviceKey key); 43Service::HID::PadState GetPadKey(HostDeviceKey key);
44 44
45} 45}