diff options
author | bunnei <bunneidev@gmail.com> | 2022-02-19 08:57:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-19 08:57:47 +0100 |
commit | 298469526501b3bd576ff1ab53d089097506a2e7 (patch) | |
tree | 269412e42ab54fdef3132c77f173a098867aceb7 /src/core/hid | |
parent | Merge pull request #7900 from german77/enter (diff) | |
parent | nfp: Allow files without password data (diff) | |
download | yuzu-298469526501b3bd576ff1ab53d089097506a2e7.tar yuzu-298469526501b3bd576ff1ab53d089097506a2e7.tar.gz yuzu-298469526501b3bd576ff1ab53d089097506a2e7.tar.bz2 yuzu-298469526501b3bd576ff1ab53d089097506a2e7.tar.lz yuzu-298469526501b3bd576ff1ab53d089097506a2e7.tar.xz yuzu-298469526501b3bd576ff1ab53d089097506a2e7.tar.zst yuzu-298469526501b3bd576ff1ab53d089097506a2e7.zip |
Diffstat (limited to 'src/core/hid')
-rw-r--r-- | src/core/hid/emulated_controller.cpp | 6 | ||||
-rw-r--r-- | src/core/hid/emulated_controller.h | 11 |
2 files changed, 15 insertions, 2 deletions
diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp index 2bee173b3..7e05666d6 100644 --- a/src/core/hid/emulated_controller.cpp +++ b/src/core/hid/emulated_controller.cpp @@ -885,6 +885,12 @@ bool EmulatedController::TestVibration(std::size_t device_index) { return SetVibration(device_index, DEFAULT_VIBRATION_VALUE); } +bool EmulatedController::SetPollingMode(Common::Input::PollingMode polling_mode) { + LOG_INFO(Service_HID, "Set polling mode {}", polling_mode); + auto& output_device = output_devices[static_cast<std::size_t>(DeviceIndex::Right)]; + return output_device->SetPollingMode(polling_mode) == Common::Input::PollingError::None; +} + void EmulatedController::SetLedPattern() { for (auto& device : output_devices) { if (!device) { diff --git a/src/core/hid/emulated_controller.h b/src/core/hid/emulated_controller.h index d8642c5b3..aa52f9572 100644 --- a/src/core/hid/emulated_controller.h +++ b/src/core/hid/emulated_controller.h @@ -299,16 +299,23 @@ public: /** * Sends a specific vibration to the output device - * @return returns true if vibration had no errors + * @return true if vibration had no errors */ bool SetVibration(std::size_t device_index, VibrationValue vibration); /** * Sends a small vibration to the output device - * @return returns true if SetVibration was successfull + * @return true if SetVibration was successfull */ bool TestVibration(std::size_t device_index); + /** + * Sets the desired data to be polled from a controller + * @param polling_mode type of input desired buttons, gyro, nfc, ir, etc. + * @return true if SetPollingMode was successfull + */ + bool SetPollingMode(Common::Input::PollingMode polling_mode); + /// Returns the led pattern corresponding to this emulated controller LedPattern GetLedPattern() const; |