reckfellENGINE

InputEventMouseButton

A mouse button or wheel-step event.

On this page
class InputEventMouseButtonReckfellSharpInherits InputEventMouse

Check ButtonIndex and the transition: press, release or cancellation. DoubleClick is a separate marker and does not replace checking Pressed. Constructing an event does not press a physical button.

The complete example detects a double left press while rejecting release and cancellation. The second method demonstrates separate gamepad-device filtering. Pass an event from your input handler; do not attach the static helper to an Entity.

C#
using Reckfell;

public static class ButtonEventExample
{
    public static bool IsDoubleLeftPress(InputEvent inputEvent)
    {
        return inputEvent is InputEventMouseButton button
            && button.ButtonIndex == MouseButton.Left
            && button.Pressed && button.DoubleClick && !button.Canceled;
    }

    public static bool IsSelectedPadPress(InputEvent inputEvent, int device, JoyButton index)
    {
        return inputEvent is InputEventJoypadButton button
            && button.Device == device && button.ButtonIndex == index && button.Pressed;
    }
}

Wheel directions use MouseButton.WheelUp, WheelDown, WheelLeft and WheelRight. Factor stores scroll amount but does not promise identical hardware units on every device.

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

Constructors1

InputEventMouseButtonConstructor
# InputEventMouseButton
C#
public InputEventMouseButton();

Creates an event without submitting input: ButtonIndex = MouseButton.None, Factor = 1; Pressed, DoubleClick and Canceled are false. Position, GlobalPosition and ButtonMask are inherited from InputEventMouse.

Properties5

ButtonIndexProperty
# ButtonIndex
C#
public MouseButton ButtonIndex { get; set; }

MouseButton button or wheel direction for this event. This is one index, not a bitmask of simultaneously held buttons; use ButtonMask for that.

CanceledProperty
# Canceled
C#
public bool Canceled { get; set; }

Cancellation flag. When true, IsPressed() and IsReleased() both return false. The setter does not erase the stored press flag: clearing Canceled can expose Pressed = true again.

DoubleClickProperty
# DoubleClick
C#
public bool DoubleClick { get; set; }

Double-click marker for this event. Does not compute time between events and does not alone imply a press: also check Pressed, ButtonIndex and Canceled.

FactorProperty
# Factor
C#
public float Factor { get; set; }

Scroll amount for a wheel event; normally 1 for an ordinary step. The setter does not clamp to 0..1; 2.5 remains 2.5. Units and precision depend on platform and device. Factor neither changes ButtonIndex nor supplies GetActionStrength.

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

Event press state. The getter accounts for Canceled: cancellation makes it false even if true was previously assigned. Do not treat !Pressed alone as an ordinary release check; inspect Canceled first.

Methods8

GetButtonIndexMouseButton
# GetButtonIndex
C#
public MouseButton GetButtonIndex();

Returns ButtonIndex without submitting input or polling the mouse again.

Returns MouseButton

MouseButton button or wheel-direction index.

GetFactorfloat
# GetFactor
C#
public float GetFactor();

Returns Factor without submitting input or polling the mouse again.

Returns float

Stored Factor value.

IsDoubleClickbool
# IsDoubleClick
C#
public bool IsDoubleClick();

Returns DoubleClick without submitting input or polling the mouse again.

Returns bool

DoubleClick flag, separate from the press-state check.

SetButtonIndexvoid
# SetButtonIndex
C#
public void SetButtonIndex(MouseButton buttonIndex);

Sets ButtonIndex using the property rules. Changes event data, not device state.

Parameters
NameTypeDefault
buttonIndexMouseButton—
buttonIndex

New ButtonIndex value; see the property for its limits.

SetCanceledvoid
# SetCanceled
C#
public void SetCanceled(bool canceled);

Sets Canceled using the property rules. Changes event data, not device state.

Parameters
NameTypeDefault
canceledbool—
canceled

New Canceled value; see the property for its limits.

SetDoubleClickvoid
# SetDoubleClick
C#
public void SetDoubleClick(bool doubleClick);

Sets DoubleClick using the property rules. Changes event data, not device state.

Parameters
NameTypeDefault
doubleClickbool—
doubleClick

New DoubleClick value; see the property for its limits.

SetFactorvoid
# SetFactor
C#
public void SetFactor(float factor);

Sets Factor using the property rules. Changes event data, not device state.

Parameters
NameTypeDefault
factorfloat—
factor

New Factor value; see the property for its limits.

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

Sets Pressed using the property rules. Changes event data, not device state.

Parameters
NameTypeDefault
pressedbool—
pressed

New Pressed value; see the property for its limits.

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.