SDL2Mouse.cs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. using Ryujinx.Common.Configuration.Hid;
  2. using Ryujinx.Input;
  3. using System;
  4. using System.Drawing;
  5. using System.Numerics;
  6. namespace Ryujinx.Headless.SDL2
  7. {
  8. class SDL2Mouse : IMouse
  9. {
  10. private SDL2MouseDriver _driver;
  11. public GamepadFeaturesFlag Features => throw new NotImplementedException();
  12. public string Id => "0";
  13. public string Name => "SDL2Mouse";
  14. public bool IsConnected => true;
  15. public bool[] Buttons => _driver.PressedButtons;
  16. Size IMouse.ClientSize => _driver.GetClientSize();
  17. public SDL2Mouse(SDL2MouseDriver driver)
  18. {
  19. _driver = driver;
  20. }
  21. public Vector2 GetPosition()
  22. {
  23. return _driver.CurrentPosition;
  24. }
  25. public Vector2 GetScroll()
  26. {
  27. return _driver.Scroll;
  28. }
  29. public GamepadStateSnapshot GetMappedStateSnapshot()
  30. {
  31. throw new NotImplementedException();
  32. }
  33. public Vector3 GetMotionData(MotionInputId inputId)
  34. {
  35. throw new NotImplementedException();
  36. }
  37. public GamepadStateSnapshot GetStateSnapshot()
  38. {
  39. throw new NotImplementedException();
  40. }
  41. public (float, float) GetStick(StickInputId inputId)
  42. {
  43. throw new NotImplementedException();
  44. }
  45. public bool IsButtonPressed(MouseButton button)
  46. {
  47. return _driver.IsButtonPressed(button);
  48. }
  49. public bool IsPressed(GamepadButtonInputId inputId)
  50. {
  51. throw new NotImplementedException();
  52. }
  53. public void Rumble(float lowFrequency, float highFrequency, uint durationMs)
  54. {
  55. throw new NotImplementedException();
  56. }
  57. public void SetConfiguration(InputConfig configuration)
  58. {
  59. throw new NotImplementedException();
  60. }
  61. public void SetTriggerThreshold(float triggerThreshold)
  62. {
  63. throw new NotImplementedException();
  64. }
  65. public void Dispose()
  66. {
  67. _driver = null;
  68. }
  69. }
  70. }