IButtonAssigner.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. namespace Ryujinx.Input.Assigner
  2. {
  3. /// <summary>
  4. /// An interface that allows to gather the driver input info to assign to a button on the UI.
  5. /// </summary>
  6. public interface IButtonAssigner
  7. {
  8. /// <summary>
  9. /// Initialize the button assigner.
  10. /// </summary>
  11. void Initialize();
  12. /// <summary>
  13. /// Read input.
  14. /// </summary>
  15. void ReadInput();
  16. /// <summary>
  17. /// Check if a button was pressed.
  18. /// </summary>
  19. /// <returns>True if a button was pressed</returns>
  20. bool HasAnyButtonPressed();
  21. /// <summary>
  22. /// Indicate if the user of this API should cancel operations. This is triggered for example when a gamepad get disconnected or when a user cancel assignation operations.
  23. /// </summary>
  24. /// <returns>True if the user of this API should cancel operations</returns>
  25. bool ShouldCancel();
  26. /// <summary>
  27. /// Get the pressed button that was read in <see cref="ReadInput"/> by the button assigner.
  28. /// </summary>
  29. /// <returns>The pressed button that was read</returns>
  30. string GetPressedButton();
  31. }
  32. }