Class FrameInput
Represents the host input snapshot for a single frame.
public sealed class FrameInput
- Inheritance
-
FrameInput
- Inherited Members
Constructors
FrameInput(Int2, bool, MouseButtonSnapshot, MouseButtonSnapshot, MouseButtonSnapshot, int, IEnumerable<InputKey>, IEnumerable<InputKey>, IEnumerable<InputKey>)
Creates a frame input snapshot.
public FrameInput(Int2 mouseScreenPositionPixels, bool isMouseInsideViewport, MouseButtonSnapshot leftButton, MouseButtonSnapshot middleButton, MouseButtonSnapshot rightButton, int mouseWheelDelta, IEnumerable<InputKey> keysDown = null, IEnumerable<InputKey> keysWentDown = null, IEnumerable<InputKey> keysWentUp = null)
Parameters
mouseScreenPositionPixelsInt2The mouse position in screen pixels.
isMouseInsideViewportboolWhether the mouse is currently inside the viewport.
leftButtonMouseButtonSnapshotThe left mouse button state.
middleButtonMouseButtonSnapshotThe middle mouse button state.
rightButtonMouseButtonSnapshotThe right mouse button state.
mouseWheelDeltaintThe wheel delta since the previous frame.
keysDownIEnumerable<InputKey>The keys that are currently down.
keysWentDownIEnumerable<InputKey>The keys that transitioned to down this frame.
keysWentUpIEnumerable<InputKey>The keys that transitioned to up this frame.
Properties
Empty
Gets a reusable empty input snapshot.
public static FrameInput Empty { get; }
Property Value
IsMouseInsideViewport
Gets a value indicating whether the mouse is currently inside the viewport.
public bool IsMouseInsideViewport { get; }
Property Value
LeftButton
Gets the left mouse-button state snapshot.
public MouseButtonSnapshot LeftButton { get; }
Property Value
MiddleButton
Gets the middle mouse-button state snapshot.
public MouseButtonSnapshot MiddleButton { get; }
Property Value
MouseScreenPositionPixels
Gets the mouse position in screen pixels.
public Int2 MouseScreenPositionPixels { get; }
Property Value
MouseWheelDelta
Gets the mouse wheel delta since the previous frame.
public int MouseWheelDelta { get; }
Property Value
RightButton
Gets the right mouse-button state snapshot.
public MouseButtonSnapshot RightButton { get; }
Property Value
Methods
IsKeyDown(InputKey)
Returns whether a key is currently pressed.
public bool IsKeyDown(InputKey key)
Parameters
keyInputKeyThe key to test.
Returns
KeyWentDown(InputKey)
Returns whether a key transitioned to down on the current frame.
public bool KeyWentDown(InputKey key)
Parameters
keyInputKeyThe key to test.
Returns
KeyWentUp(InputKey)
Returns whether a key transitioned to up on the current frame.
public bool KeyWentUp(InputKey key)
Parameters
keyInputKeyThe key to test.