Class MouseDeviceState
An extension to PointerDeviceState that handle mouse input and translates it to pointer input
public class MouseDeviceState
- Inheritance
-
MouseDeviceState
Constructors
MouseDeviceState(PointerDeviceState, IMouseDevice)
public MouseDeviceState(PointerDeviceState pointerState, IMouseDevice mouseDevice)
Parameters
pointerState
PointerDeviceStatemouseDevice
IMouseDevice
Fields
Events
protected readonly List<InputEvent> Events
Field Value
MouseDevice
protected IMouseDevice MouseDevice
Field Value
PointerState
protected PointerDeviceState PointerState
Field Value
Properties
Delta
public Vector2 Delta { get; set; }
Property Value
DownButtons
public IReadOnlySet<MouseButton> DownButtons { get; }
Property Value
Position
public Vector2 Position { get; set; }
Property Value
PressedButtons
public IReadOnlySet<MouseButton> PressedButtons { get; }
Property Value
ReleasedButtons
public IReadOnlySet<MouseButton> ReleasedButtons { get; }
Property Value
Methods
HandleButtonDown(MouseButton)
public void HandleButtonDown(MouseButton button)
Parameters
button
MouseButton
HandleButtonUp(MouseButton)
public void HandleButtonUp(MouseButton button)
Parameters
button
MouseButton
HandleMouseDelta(Vector2)
Special move that generates pointer events with just delta
public void HandleMouseDelta(Vector2 delta)
Parameters
delta
Vector2The movement delta
HandleMouseWheel(float)
public void HandleMouseWheel(float wheelDelta)
Parameters
wheelDelta
float
HandleMove(Vector2)
Handles a single pointer move
public void HandleMove(Vector2 newPosition)
Parameters
newPosition
Vector2New position of the pointer
HandlePointerDown()
Handles a single pointer down
public void HandlePointerDown()
HandlePointerUp()
Handles a single pointer up
public void HandlePointerUp()
Update(List<InputEvent>)
Generate input events
public void Update(List<InputEvent> inputEvents)
Parameters
inputEvents
List<InputEvent>