Table of Contents

Class WidgetInput

Namespace
Lime
Assembly
Lime.dll

WidgetInput class allows a widget to capture an input device (mouse, keyboard). After capturing the device, the widget and all its children receive an actual buttons and device axes state (e.g. mouse position). Other widgets receive released buttons state and frozen axes values.

public class WidgetInput : IDisposable
Inheritance
WidgetInput
Implements
Inherited Members

Constructors

WidgetInput(Widget)

public WidgetInput(Widget widget)

Parameters

widget Widget

Fields

AcceptMouseBeyondWidget

Indicates whether mouse events should be accepted even the widget is not under the mouse cursor.

public bool AcceptMouseBeyondWidget

Field Value

bool

AcceptMouseBeyondWidgetByDefault

public static bool AcceptMouseBeyondWidgetByDefault

Field Value

bool

AcceptMouseThroughDescendants

Indicates whether mouse events should be accepted even the mouse is over one of widget's descendant.

public bool AcceptMouseThroughDescendants

Field Value

bool

Filter

public static WidgetInput.FilterFunc Filter

Field Value

WidgetInput.FilterFunc

Properties

CurrentScope

Returns input scope widget with highest priority.

public Widget CurrentScope { get; }

Property Value

Widget

LocalMousePosition

[Obsolete("Use Widget.LocalMousePosition()")]
public Vector2 LocalMousePosition { get; }

Property Value

Vector2

MousePosition

public Vector2 MousePosition { get; }

Property Value

Vector2

TextInput

public string TextInput { get; }

Property Value

string

WheelScrollAmount

public float WheelScrollAmount { get; }

Property Value

float

Methods

CaptureAll()

[Obsolete("Use RestrictScope() instead")]
public void CaptureAll()

ConsumeKey(Key)

public void ConsumeKey(Key key)

Parameters

key Key

ConsumeKeyPress(Key)

public bool ConsumeKeyPress(Key key)

Parameters

key Key

Returns

bool

ConsumeKeyRelease(Key)

public bool ConsumeKeyRelease(Key key)

Parameters

key Key

Returns

bool

ConsumeKeyRepeat(Key)

public bool ConsumeKeyRepeat(Key key)

Parameters

key Key

Returns

bool

ConsumeKeys(IEnumerable<Key>)

public void ConsumeKeys(IEnumerable<Key> keys)

Parameters

keys IEnumerable<Key>

ConsumeKeys(List<Key>)

public void ConsumeKeys(List<Key> keys)

Parameters

keys List<Key>

DerestrictScope()

Derestricts input scope from the current widget and its descendants.

public void DerestrictScope()

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

EnumerateScopes()

Enumerates input scope stack from top to bottom. Top being the highest priority input scope widget.

public IEnumerable<Widget> EnumerateScopes()

Returns

IEnumerable<Widget>

GetNumTouches()

public int GetNumTouches()

Returns

int

GetTouchPosition(int)

public Vector2 GetTouchPosition(int index)

Parameters

index int

Returns

Vector2

IsAcceptingKey(Key)

public bool IsAcceptingKey(Key key)

Parameters

key Key

Returns

bool

IsAcceptingMouse()

public bool IsAcceptingMouse()

Returns

bool

IsKeyPressed(Key)

public bool IsKeyPressed(Key key)

Parameters

key Key

Returns

bool

IsMousePressed(int)

public bool IsMousePressed(int button = 0)

Parameters

button int

Returns

bool

ReleaseAll()

[Obsolete("Use DerestrictScope() instead")]
public void ReleaseAll()

RestrictScope()

Restricts input scope with the current widget and its descendants.

public void RestrictScope()

WasAnyMouseButtonPressed()

public bool WasAnyMouseButtonPressed()

Returns

bool

WasKeyPressed(Key)

public bool WasKeyPressed(Key key)

Parameters

key Key

Returns

bool

WasKeyReleased(Key)

public bool WasKeyReleased(Key key)

Parameters

key Key

Returns

bool

WasKeyRepeated(Key)

public bool WasKeyRepeated(Key key)

Parameters

key Key

Returns

bool

WasMousePressed(int)

public bool WasMousePressed(int button = 0)

Parameters

button int

Returns

bool

WasMouseReleased(int)

public bool WasMouseReleased(int button = 0)

Parameters

button int

Returns

bool