summaryrefslogtreecommitdiff
path: root/src/core/hid
diff options
context:
space:
mode:
authorGravatar liamwhite2023-11-16 09:13:56 -0500
committerGravatar GitHub2023-11-16 09:13:56 -0500
commit7eac28e410e5c3293125602b91d8082e2c57ade1 (patch)
treeb2a263584ca273e636ae76e9bf47b1974f4ef68e /src/core/hid
parentMerge pull request #12007 from german77/moar_buttons (diff)
parentservice: hid: Split hid.cpp into individual interfaces (diff)
downloadyuzu-7eac28e410e5c3293125602b91d8082e2c57ade1.tar.gz
yuzu-7eac28e410e5c3293125602b91d8082e2c57ade1.tar.xz
yuzu-7eac28e410e5c3293125602b91d8082e2c57ade1.zip
Merge pull request #12038 from german77/no_implement
service: hid: Split hid.cpp into individual interfaces
Diffstat (limited to 'src/core/hid')
-rw-r--r--src/core/hid/emulated_console.h8
-rw-r--r--src/core/hid/hid_types.h8
-rw-r--r--src/core/hid/input_interpreter.cpp7
3 files changed, 12 insertions, 11 deletions
diff --git a/src/core/hid/emulated_console.h b/src/core/hid/emulated_console.h
index 79114bb6d..fae15a556 100644
--- a/src/core/hid/emulated_console.h
+++ b/src/core/hid/emulated_console.h
@@ -38,14 +38,6 @@ using TouchParams = std::array<Common::ParamPackage, MaxTouchDevices>;
38using ConsoleMotionValues = ConsoleMotionInfo; 38using ConsoleMotionValues = ConsoleMotionInfo;
39using TouchValues = std::array<Common::Input::TouchStatus, MaxTouchDevices>; 39using TouchValues = std::array<Common::Input::TouchStatus, MaxTouchDevices>;
40 40
41struct TouchFinger {
42 u64 last_touch{};
43 Common::Point<float> position{};
44 u32 id{};
45 TouchAttribute attribute{};
46 bool pressed{};
47};
48
49// Contains all motion related data that is used on the services 41// Contains all motion related data that is used on the services
50struct ConsoleMotion { 42struct ConsoleMotion {
51 Common::Vec3f accel{}; 43 Common::Vec3f accel{};
diff --git a/src/core/hid/hid_types.h b/src/core/hid/hid_types.h
index 7ba75a50c..9d48cd90e 100644
--- a/src/core/hid/hid_types.h
+++ b/src/core/hid/hid_types.h
@@ -356,6 +356,14 @@ struct TouchState {
356}; 356};
357static_assert(sizeof(TouchState) == 0x28, "Touchstate is an invalid size"); 357static_assert(sizeof(TouchState) == 0x28, "Touchstate is an invalid size");
358 358
359struct TouchFinger {
360 u64 last_touch{};
361 Common::Point<float> position{};
362 u32 id{};
363 TouchAttribute attribute{};
364 bool pressed{};
365};
366
359// This is nn::hid::TouchScreenConfigurationForNx 367// This is nn::hid::TouchScreenConfigurationForNx
360struct TouchScreenConfigurationForNx { 368struct TouchScreenConfigurationForNx {
361 TouchScreenModeForNx mode{TouchScreenModeForNx::UseSystemSetting}; 369 TouchScreenModeForNx mode{TouchScreenModeForNx::UseSystemSetting};
diff --git a/src/core/hid/input_interpreter.cpp b/src/core/hid/input_interpreter.cpp
index 76d6b8ab0..11359f318 100644
--- a/src/core/hid/input_interpreter.cpp
+++ b/src/core/hid/input_interpreter.cpp
@@ -5,13 +5,14 @@
5#include "core/hid/hid_types.h" 5#include "core/hid/hid_types.h"
6#include "core/hid/input_interpreter.h" 6#include "core/hid/input_interpreter.h"
7#include "core/hle/service/hid/controllers/npad.h" 7#include "core/hle/service/hid/controllers/npad.h"
8#include "core/hle/service/hid/hid.h" 8#include "core/hle/service/hid/hid_server.h"
9#include "core/hle/service/hid/resource_manager.h"
9#include "core/hle/service/sm/sm.h" 10#include "core/hle/service/sm/sm.h"
10 11
11InputInterpreter::InputInterpreter(Core::System& system) 12InputInterpreter::InputInterpreter(Core::System& system)
12 : npad{system.ServiceManager() 13 : npad{system.ServiceManager()
13 .GetService<Service::HID::Hid>("hid") 14 .GetService<Service::HID::IHidServer>("hid")
14 ->GetAppletResource() 15 ->GetResourceManager()
15 ->GetController<Service::HID::Controller_NPad>(Service::HID::HidController::NPad)} { 16 ->GetController<Service::HID::Controller_NPad>(Service::HID::HidController::NPad)} {
16 ResetButtonStates(); 17 ResetButtonStates();
17} 18}