reckfellENGINE

InputEventAction

A synthetic event for an InputMap action.

On this page
class InputEventActionReckfellSharpInherits InputEvent

InputEventAction represents a logical action, not a physical key. Constructing or editing the object does not inject a press into the game. Submit it with Input.ParseInputEvent; with buffering, global state can update later when the queue is processed.

The complete example requires an already registered action and creates a fresh event object for every call. Send a matching release for each press. Multiple virtual buttons for one action need their combined state coordinated: EventIndex = -1 does not create an independent hold for each button.

C#
using System;
using Reckfell;

public static class VirtualActionExample
{
    // The action must already exist. Each call creates a fresh event object.
    public static void Send(StringName action, bool pressed, float strength = 1f)
    {
        if (!InputMap.HasAction(action))
            throw new ArgumentException("Register the action before sending input.", nameof(action));
        if (!float.IsFinite(strength))
            throw new ArgumentOutOfRangeException(nameof(strength));
        using var inputEvent = new InputEventAction
        {
            Action = action,
            Pressed = pressed,
            Strength = pressed ? strength : 0f
        };
        Input.ParseInputEvent(inputEvent);
    }
}

The event does not move the OS pointer or simulate a physical key. Changing InputMap while held can change slot selection: finish the press before editing bindings.

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

Constructors1

InputEventActionConstructor
# InputEventAction
C#
public InputEventAction();

Creates an event without submitting input: Action is empty, Pressed = false, Strength = 1 and EventIndex = -1. Editing its properties does not itself change global Input state.

Properties4

ActionProperty
# Action
C#
public StringName Action { get; set; }

Logical action name. Input processing requires the action to exist in InputMap. Assigning the name does not create the action, a key binding or a physical key press.

EventIndexProperty
# EventIndex
C#
public int EventIndex { get; set; }

Source index within the action. With -1, processing uses the extra virtual slot after its bindings, not a unique event-instance ID. Events for the same action and device share that slot; releasing one does not retain another source's independent hold. Do not change InputMap bindings between a press/release pair or use arbitrary numbers as button IDs.

PressedProperty
# Pressed
C#
public bool Pressed { get; set; }

Virtual action state in this event: true for press, false for release. Assigning it does not submit the event. Release does not clear the stored Strength; matching a released action nevertheless reports strength 0.

StrengthProperty
# Strength
C#
public float Strength { get; set; }

Stored event strength. Finite values are clamped to 0..1; the initial value is 1. The property is not automatically cleared when Pressed = false, but GetActionStrength reports 0 for release. Validate that your own inputs are finite.

Methods7

GetActionStringName
# GetAction
C#
public StringName GetAction();

Returns Action without submitting the event or changing Input.

Returns StringName

Logical action name.

GetEventIndexint
# GetEventIndex
C#
public int GetEventIndex();

Returns EventIndex without submitting the event or changing Input.

Returns int

Source index; -1 selects the shared virtual slot.

GetStrengthfloat
# GetStrength
C#
public float GetStrength();

Returns Strength without submitting the event or changing Input.

Returns float

Stored strength in 0..1 for finite inputs, independent of Pressed.

SetActionvoid
# SetAction
C#
public void SetAction(StringName action);

Sets Action using the property rules; does not submit the event.

Parameters
NameTypeDefault
actionStringName—
action

Logical action name.

SetEventIndexvoid
# SetEventIndex
C#
public void SetEventIndex(int index);

Sets EventIndex using the property rules; does not submit the event.

Parameters
NameTypeDefault
indexint—
index

Source index; -1 selects the shared virtual slot.

SetPressedvoid
# SetPressed
C#
public void SetPressed(bool pressed);

Sets Pressed; neither submits the event nor changes the stored Strength.

Parameters
NameTypeDefault
pressedbool—
pressed

true for press, false for release.

SetStrengthvoid
# SetStrength
C#
public void SetStrength(float strength);

Sets Strength using the property rules; does not submit the event.

Parameters
NameTypeDefault
strengthfloat—
strength

Stored strength in 0..1 for finite inputs, independent of Pressed.

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.