IInputStateChangeMonitor.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. ////REVIEW: could have a monitor path where if there's multiple state monitors on the same control with
  2. //// the same listener, the monitor is notified only once but made aware of the multiple triggers
  3. namespace UnityEngine.InputSystem.LowLevel
  4. {
  5. /// <summary>
  6. /// Interface used to monitor input system state changes.
  7. /// </summary>
  8. /// <remarks>
  9. /// Use <see cref="InputSystem.AddStateChangeMonitor"/> to install a state change monitor receiving state change
  10. /// callbacks for a specific control.
  11. /// </remarks>
  12. /// <seealso cref="InputState.AddChangeMonitor(InputControl,IInputStateChangeMonitor,long)"/>
  13. public interface IInputStateChangeMonitor
  14. {
  15. /// <summary>
  16. /// Called when the state monitored by a state change monitor has been modified.
  17. /// </summary>
  18. /// <param name="control">Control that is being monitored by the state change monitor and that had its state
  19. /// memory changed.</param>
  20. /// <param name="time"></param>
  21. /// <param name="eventPtr">If the state change was initiated by a state event, this is the pointer to the event.
  22. /// Otherwise it is null.</param>
  23. /// <param name="monitorIndex"></param>
  24. void NotifyControlStateChanged(InputControl control, double time, InputEventPtr eventPtr, long monitorIndex);
  25. /// <summary>
  26. /// Called when a timeout set on a state change monitor has expired.
  27. /// </summary>
  28. /// <param name="control"></param>
  29. /// <param name="time"></param>
  30. /// <param name="monitorIndex"></param>
  31. /// <param name="timerIndex"></param>
  32. /// <seealso cref="InputState.AddChangeMonitorTimeout"/>
  33. void NotifyTimerExpired(InputControl control, double time, long monitorIndex, int timerIndex);
  34. }
  35. }