reckfellENGINE

InputEvent

Inspect one input event, match actions and transform coordinates.

On this page
class InputEventReckfellSharpInherits Resource

InputEvent is the base Resource for one event; its concrete type defines fields and behavior. event.IsActionPressed() concerns this event, while Input.IsActionPressed() reads current aggregate state. Constructing/querying an event injects no input into the game or OS.

IsAction checks a match rather than held state. IsActionReleased means matching inactive pressed-state: canceled mouse and an axis within deadzone can also return true. Check IsCanceled and concrete type when the cause matters. IsActionPressed filters echo by default.

IsMatch defaults exactMatch to true, while action queries default to false. Not universal equality: cross-subtype comparison can be asymmetric. XformedBy is subtype-dependent too: MouseMotion creates a copy while Key can return the same reference.

Input handling. Synthetic objects and temporary InputMap actions were tested on Windows; real keyboards/controllers, GUI routing and window-focus loss were not accepted here.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Properties1

DeviceProperty
# Device
C#
public int Device { get; set; }

Event device-ID metadata. Assignment neither selects hardware nor injects a press; the setter emits Changed. Special negative values exist. InputMap can filter bindings by Device, but direct IsMatch/Accumulate need not check it uniformly across subtypes.

Methods15

Accumulatebool
# Accumulate
C#
public bool Accumulate(InputEvent withEvent);

Attempts to merge withEvent into this object, mutating the receiver on success. Injects no input and does not control global Input.UseAccumulatedInput. Base behavior is false; InputEventMouseMotion was tested: Relative/ScreenRelative are summed and Position/GlobalPosition/Velocity/ScreenVelocity use the latest event. Window/state/modifiers must be compatible. Direct MouseMotion.Accumulate does not check Device; filter devices yourself when separation matters. Not universal addition of every field or every event type.

Parameters
NameTypeDefault
withEventInputEvent—
withEvent

Second event to merge into the receiver; check subtype/Device if required by your protocol.

Returns bool

True after a successful receiver mutation, or false without a supported merge.

AsTextstring
# AsText
C#
public string AsText();

Human-readable label of the concrete event; format/localization depend on subtype. Not for serialization, equality or a stable action ID. InputEventAction can show the first InputMap binding rather than its Action name; with no bindings it may be empty.

Returns string

Human-readable, possibly empty label without a stable format.

GetActionStrengthfloat
# GetActionStrength
C#
public float GetActionStrength(StringName action, bool exactMatch = false);

Strength of the specified action in this event, not current aggregate Input state. Digital press is normally 1 and release 0; axes apply binding deadzone, while InputEventAction uses stored Strength only when Pressed. A nonmatching event returns 0. The action must exist in InputMap; an unknown name is diagnosed rather than providing a safe TryGet.

Parameters
NameTypeDefault
actionStringName—
exactMatchboolfalse
action

Existing InputMap action name rather than a key code; use HasAction first for dynamic names.

exactMatch

True requires exact subtype modifier/direction matching. IsMatch defaults to true; action queries default to false.

Returns float

Action strength in this event, normally 0…1; also 0 for no match.

GetDeviceint
# GetDevice
C#
public int GetDevice();

Returns this event Device metadata, not a connected-device or keyboard-state query.

Returns int

Current integer Device metadata.

IsActionbool
# IsAction
C#
public bool IsAction(StringName action, bool exactMatch = false);

Tests this event against an existing InputMap action regardless of pressed/released state or strength. Thus true can describe a release or an axis within deadzone. Default exactMatch=false allows extra modifiers under subtype rules. Changes no Input state and does not mean the action is currently held.

Parameters
NameTypeDefault
actionStringName—
exactMatchboolfalse
action

Existing InputMap action name rather than a key code; use HasAction first for dynamic names.

exactMatch

True requires exact subtype modifier/direction matching. IsMatch defaults to true; action queries default to false.

Returns bool

Match result independent of pressed-state.

IsActionPressedbool
# IsActionPressed
C#
public bool IsActionPressed(StringName action, bool allowEcho = false, bool exactMatch = false);

True when the event matches the action and its action pressed-state is active. Keyboard echo is excluded while allowEcho=false. Tests this event rather than global Input.IsActionJustPressed and consumes nothing. exactMatch controls modifier/direction matching by event type. Axis results depend on deadzone rather than movement alone.

Parameters
NameTypeDefault
actionStringName—
allowEchoboolfalse
exactMatchboolfalse
action

Existing InputMap action name rather than a key code; use HasAction first for dynamic names.

allowEcho

True allows keyboard echo; false filters it in IsActionPressed.

exactMatch

True requires exact subtype modifier/direction matching. IsMatch defaults to true; action queries default to false.

Returns bool

Matching active press with echo/deadzone rules applied.

IsActionReleasedbool
# IsActionReleased
C#
public bool IsActionReleased(StringName action, bool exactMatch = false);

True for a matching action with inactive pressed-state. Not universal proof of a physical release: canceled mouse and an axis within deadzone also returned true. Check IsCanceled and concrete type when the cause matters. Nonexact key release can match a binding whose modifiers are no longer held. Not global Input.IsActionJustReleased.

Parameters
NameTypeDefault
actionStringName—
exactMatchboolfalse
action

Existing InputMap action name rather than a key code; use HasAction first for dynamic names.

exactMatch

True requires exact subtype modifier/direction matching. IsMatch defaults to true; action queries default to false.

Returns bool

Match with inactive pressed-state, not proof of a physical release.

IsActionTypebool
# IsActionType
C#
public bool IsActionType();

Classifies a subtype as action-capable without checking a particular InputMap binding. A key returned true and MouseMotion false in the probe. Not IsAction, a Pressed check or permission to modify InputMap.

Returns bool

Subtype capability rather than a configured-action match.

IsCanceledbool
# IsCanceled
C#
public bool IsCanceled();

Returns the event cancellation flag. Canceled events have both base IsPressed and IsReleased false, while IsActionReleased can still return true through action matching. Cancellation differs from ordinary release. Actual window-focus cancellation transitions were not tested here.

Returns bool

Stored event-cancellation flag.

IsEchobool
# IsEcho
C#
public bool IsEcho();

Reports repeat/echo where supported by a subtype such as InputEventKey. Base behavior is false. Does not mean a double click or automatically repeating game action. IsActionPressed filters echo by default.

Returns bool

Subtype repeat/echo flag, false in the base.

IsMatchbool
# IsMatch
C#
public bool IsMatch(InputEvent @event, bool exactMatch = true);

Compares by concrete subtype rules rather than every serialized field. Defaults to exactMatch=true, unlike IsAction. Pressed/strength/Device need not determine the result. Cross-subtype comparison can be asymmetric: InputEventAction can check a key through its InputMap action while the key need not match the Action in reverse. Not universal equality/hash.

Parameters
NameTypeDefault
eventInputEvent—
exactMatchbooltrue
event

Another InputEvent; receiver-specific comparison can be asymmetric.

exactMatch

True requires exact subtype modifier/direction matching. IsMatch defaults to true; action queries default to false.

Returns bool

Match under receiver-subtype rules.

IsPressedbool
# IsPressed
C#
public bool IsPressed();

Returns stored pressed && !canceled for this object. A manually created event need not reflect OS state. Use the corresponding action query for axis/deadzone behavior and Input for current held state. Does not check event type.

Returns bool

This object pressed && !canceled.

IsReleasedbool
# IsReleased
C#
public bool IsReleased();

Returns !pressed && !canceled. For button-like events this is a local released-state flag rather than proof of a real key/button transition, especially for synthetic or other subtypes. Distinct from IsActionReleased and global Input state.

Returns bool

This object !pressed && !canceled.

SetDevicevoid
# SetDevice
C#
public void SetDevice(int device);

Changes Device and emits Resource.Changed. Rebinds no action, connects no device and injects no OS event. Do not mutate a shared dispatched event while other code still needs its original metadata.

Parameters
NameTypeDefault
deviceint—
device

Device metadata including special values, not an OS handle.

XformedByInputEvent
# XformedBy
C#
public InputEvent XformedBy(Transform2D xform, Vector2? localOfs = default);

Transforms coordinate-bearing events under subtype rules. MouseMotion was tested for a new copy, position = xform*(position+localOfs), basis-only Relative/Velocity transforms, and preserved ScreenRelative/ScreenVelocity/GlobalPosition. Key base behavior returns the same object and C# wrapper, so an independent copy is not guaranteed. Do not Dispose that alias while the original is used. Neither moves events between OS windows nor injects input.

Parameters
NameTypeDefault
xformTransform2D—
localOfsVector2?default
xform

2D transform for local coordinates; screen-space fields may remain unchanged.

localOfs

Offset added before xform for positional events; null/default means Vector2.Zero.

Returns InputEvent

InputEvent: a new copy or the same shared object depending on subtype.

Fields and constants3

DeviceIdEmulationField
# DeviceIdEmulation
C#
public const long DeviceIdEmulation = -1;

Special value −1 for emulated events such as mouse from touch. Does not mean every manually created InputEventAction automatically gets this ID. Not an OS handle or player number.

DeviceIdKeyboardField
# DeviceIdKeyboard
C#
public const long DeviceIdKeyboard = 16;

Value 16 used by InputEventKey construction as the keyboard category. Not a key index, scan code or guaranteed separation of multiple physical keyboards.

DeviceIdMouseField
# DeviceIdMouse
C#
public const long DeviceIdMouse = 32;

Value 32 used by mouse-event construction. Not a button index or OS window ID. This value does not establish support for multiple physical mice.

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.