diff options
author | german77 <juangerman-13@hotmail.com> | 2022-01-30 16:15:29 +0100 |
---|---|---|
committer | german77 <juangerman-13@hotmail.com> | 2022-01-30 16:17:22 +0100 |
commit | 3d2d77eb3f0e0b5cb9c881d33ba2406e61736723 (patch) | |
tree | 1353da12f172cc54af4c98d97b7aa20c92440333 /src/input_common/drivers | |
parent | Merge pull request #7791 from german77/wall_clock (diff) | |
download | yuzu-3d2d77eb3f0e0b5cb9c881d33ba2406e61736723.tar yuzu-3d2d77eb3f0e0b5cb9c881d33ba2406e61736723.tar.gz yuzu-3d2d77eb3f0e0b5cb9c881d33ba2406e61736723.tar.bz2 yuzu-3d2d77eb3f0e0b5cb9c881d33ba2406e61736723.tar.lz yuzu-3d2d77eb3f0e0b5cb9c881d33ba2406e61736723.tar.xz yuzu-3d2d77eb3f0e0b5cb9c881d33ba2406e61736723.tar.zst yuzu-3d2d77eb3f0e0b5cb9c881d33ba2406e61736723.zip |
Diffstat (limited to 'src/input_common/drivers')
-rw-r--r-- | src/input_common/drivers/udp_client.cpp | 15 | ||||
-rw-r--r-- | src/input_common/drivers/udp_client.h | 4 |
2 files changed, 16 insertions, 3 deletions
diff --git a/src/input_common/drivers/udp_client.cpp b/src/input_common/drivers/udp_client.cpp index d1cdb1ab2..333173e3d 100644 --- a/src/input_common/drivers/udp_client.cpp +++ b/src/input_common/drivers/udp_client.cpp @@ -271,7 +271,7 @@ void UDPClient::OnPadData(Response::PadData data, std::size_t client) { const auto touch_axis_y_id = static_cast<int>(id == 0 ? PadAxes::Touch1Y : PadAxes::Touch2Y); const auto touch_button_id = - static_cast<int>(id == 0 ? PadButton::Touch1 : PadButton::touch2); + static_cast<int>(id == 0 ? PadButton::Touch1 : PadButton::Touch2); // TODO: Use custom calibration per device const Common::ParamPackage touch_param(Settings::values.touch_device.GetValue()); @@ -319,6 +319,9 @@ void UDPClient::OnPadData(Response::PadData data, std::size_t client) { SetButton(identifier, button, button_status); } + SetButton(identifier, static_cast<int>(PadButton::Home), data.home != 0); + SetButton(identifier, static_cast<int>(PadButton::TouchHardPress), data.touch_hard_press != 0); + SetBattery(identifier, GetBatteryLevel(data.info.battery)); } @@ -393,7 +396,7 @@ std::vector<Common::ParamPackage> UDPClient::GetInputDevices() const { ButtonMapping UDPClient::GetButtonMappingForDevice(const Common::ParamPackage& params) { // This list excludes any button that can't be really mapped - static constexpr std::array<std::pair<Settings::NativeButton::Values, PadButton>, 18> + static constexpr std::array<std::pair<Settings::NativeButton::Values, PadButton>, 20> switch_to_dsu_button = { std::pair{Settings::NativeButton::A, PadButton::Circle}, {Settings::NativeButton::B, PadButton::Cross}, @@ -413,6 +416,8 @@ ButtonMapping UDPClient::GetButtonMappingForDevice(const Common::ParamPackage& p {Settings::NativeButton::SR, PadButton::R2}, {Settings::NativeButton::LStick, PadButton::L3}, {Settings::NativeButton::RStick, PadButton::R3}, + {Settings::NativeButton::Home, PadButton::Home}, + {Settings::NativeButton::Screenshot, PadButton::TouchHardPress}, }; if (!params.Has("guid") || !params.Has("port") || !params.Has("pad")) { return {}; @@ -517,6 +522,12 @@ Common::Input::ButtonNames UDPClient::GetUIButtonName(const Common::ParamPackage return Common::Input::ButtonNames::Share; case PadButton::Options: return Common::Input::ButtonNames::Options; + case PadButton::Home: + return Common::Input::ButtonNames::Home; + case PadButton::Touch1: + case PadButton::Touch2: + case PadButton::TouchHardPress: + return Common::Input::ButtonNames::Touch; default: return Common::Input::ButtonNames::Undefined; } diff --git a/src/input_common/drivers/udp_client.h b/src/input_common/drivers/udp_client.h index 30d7c2682..e9c178139 100644 --- a/src/input_common/drivers/udp_client.h +++ b/src/input_common/drivers/udp_client.h @@ -84,7 +84,9 @@ private: Cross = 0x4000, Square = 0x8000, Touch1 = 0x10000, - touch2 = 0x20000, + Touch2 = 0x20000, + Home = 0x40000, + TouchHardPress = 0x80000, }; enum class PadAxes : u8 { |