diff options
| author | bunnei <bunneidev@gmail.com> | 2018-11-19 08:30:10 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-11-19 08:30:10 -0800 |
| commit | 048da7240d793245b156eb29ac52e9b5a514a64d (patch) | |
| tree | 30662cee6d3b3ce2a93c40530939902b6f3900db /src/core/hle/service/hid/controllers/touchscreen.cpp | |
| parent | f02b125ac8903db5d2dad351a9c68b2a062c4467 (diff) | |
| parent | aef0d88165d08732120de11364701a5f5d0f9a7f (diff) | |
Merge pull request #1634 from DarkLordZach/better-hid-2
hid: Add support for multiplayer and multilayout controllers
Diffstat (limited to 'src/core/hle/service/hid/controllers/touchscreen.cpp')
| -rw-r--r-- | src/core/hle/service/hid/controllers/touchscreen.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/core/hle/service/hid/controllers/touchscreen.cpp b/src/core/hle/service/hid/controllers/touchscreen.cpp index 43efef803..f666b1bd8 100644 --- a/src/core/hle/service/hid/controllers/touchscreen.cpp +++ b/src/core/hle/service/hid/controllers/touchscreen.cpp @@ -41,16 +41,17 @@ void Controller_Touchscreen::OnUpdate(u8* data, std::size_t size) { const auto [x, y, pressed] = touch_device->GetStatus(); auto& touch_entry = cur_entry.states[0]; - if (pressed) { + touch_entry.attribute.raw = 0; + if (pressed && Settings::values.touchscreen.enabled) { touch_entry.x = static_cast<u16>(x * Layout::ScreenUndocked::Width); touch_entry.y = static_cast<u16>(y * Layout::ScreenUndocked::Height); - touch_entry.diameter_x = 15; - touch_entry.diameter_y = 15; - touch_entry.rotation_angle = 0; + touch_entry.diameter_x = Settings::values.touchscreen.diameter_x; + touch_entry.diameter_y = Settings::values.touchscreen.diameter_y; + touch_entry.rotation_angle = Settings::values.touchscreen.rotation_angle; const u64 tick = CoreTiming::GetTicks(); touch_entry.delta_time = tick - last_touch; last_touch = tick; - touch_entry.finger = 0; + touch_entry.finger = Settings::values.touchscreen.finger; cur_entry.entry_count = 1; } else { cur_entry.entry_count = 0; @@ -60,6 +61,6 @@ void Controller_Touchscreen::OnUpdate(u8* data, std::size_t size) { } void Controller_Touchscreen::OnLoadInputDevices() { - touch_device = Input::CreateDevice<Input::TouchDevice>(Settings::values.touch_device); + touch_device = Input::CreateDevice<Input::TouchDevice>(Settings::values.touchscreen.device); } } // namespace Service::HID |
