SDL2Mouse.cs 2.1 KB

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