stick_from_buttons.h 1.2 KB

1234567891011121314151617181920212223242526272829
  1. // SPDX-FileCopyrightText: 2017 Citra Emulator Project
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #pragma once
  4. #include "common/input.h"
  5. namespace InputCommon {
  6. /**
  7. * An analog device factory that takes direction button devices and combines them into a analog
  8. * device.
  9. */
  10. class StickFromButton final : public Common::Input::Factory<Common::Input::InputDevice> {
  11. public:
  12. /**
  13. * Creates an analog device from direction button devices
  14. * @param params contains parameters for creating the device:
  15. * - "up": a serialized ParamPackage for creating a button device for up direction
  16. * - "down": a serialized ParamPackage for creating a button device for down direction
  17. * - "left": a serialized ParamPackage for creating a button device for left direction
  18. * - "right": a serialized ParamPackage for creating a button device for right direction
  19. * - "modifier": a serialized ParamPackage for creating a button device as the modifier
  20. * - "modifier_scale": a float for the multiplier the modifier gives to the position
  21. */
  22. std::unique_ptr<Common::Input::InputDevice> Create(const Common::ParamPackage& params) override;
  23. };
  24. } // namespace InputCommon