core/hid: Add output devices

This commit is contained in:
german77 2021-10-11 00:43:11 -05:00 committed by Narr the Reg
parent e14ae06391
commit 06a5ef5874
20 changed files with 313 additions and 145 deletions

View file

@ -251,7 +251,8 @@ private:
std::chrono::time_point<std::chrono::steady_clock> last_update;
};
std::unique_ptr<Input::InputDevice> StickFromButton::Create(const Common::ParamPackage& params) {
std::unique_ptr<Input::InputDevice> StickFromButton::Create(
const Common::ParamPackage& params) {
const std::string null_engine = Common::ParamPackage{{"engine", "null"}}.Serialize();
auto up = Input::CreateDeviceFromString<Input::InputDevice>(params.Get("up", null_engine));
auto down = Input::CreateDeviceFromString<Input::InputDevice>(params.Get("down", null_engine));

View file

@ -25,7 +25,8 @@ public:
* - "modifier": a serialized ParamPackage for creating a button device as the modifier
* - "modifier_scale": a float for the multiplier the modifier gives to the position
*/
std::unique_ptr<Input::InputDevice> Create(const Common::ParamPackage& params) override;
std::unique_ptr<Input::InputDevice> Create(
const Common::ParamPackage& params) override;
};
} // namespace InputCommon

View file

@ -57,7 +57,9 @@ private:
const Input::AnalogProperties properties{0.0f, 1.0f, 0.5f, 0.0f, false};
};
std::unique_ptr<Input::InputDevice> TouchFromButton::Create(const Common::ParamPackage& params) {
std::unique_ptr<Input::InputDevice> TouchFromButton::Create(
const Common::ParamPackage& params) {
const std::string null_engine = Common::ParamPackage{{"engine", "null"}}.Serialize();
auto button =
Input::CreateDeviceFromString<Input::InputDevice>(params.Get("button", null_engine));