analog_from_button.h 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. // Copyright 2017 Citra Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include <memory>
  6. #include "core/frontend/input.h"
  7. namespace InputCommon {
  8. /**
  9. * An analog device factory that takes direction button devices and combines them into a analog
  10. * device.
  11. */
  12. class AnalogFromButton final : public Input::Factory<Input::AnalogDevice> {
  13. public:
  14. /**
  15. * Creates an analog device from direction button devices
  16. * @param params contains parameters for creating the device:
  17. * - "up": a serialized ParamPackage for creating a button device for up direction
  18. * - "down": a serialized ParamPackage for creating a button device for down direction
  19. * - "left": a serialized ParamPackage for creating a button device for left direction
  20. * - "right": a serialized ParamPackage for creating a button device for right direction
  21. * - "modifier": a serialized ParamPackage for creating a button device as the modifier
  22. * - "modifier_scale": a float for the multiplier the modifier gives to the position
  23. */
  24. std::unique_ptr<Input::AnalogDevice> Create(const Common::ParamPackage& params) override;
  25. };
  26. } // namespace InputCommon