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
AcceptMouseBeyondWidgetByDefault
public static bool AcceptMouseBeyondWidgetByDefault
Field Value
AcceptMouseThroughDescendants
Indicates whether mouse events should be accepted even the mouse is over one of widget's descendant.
public bool AcceptMouseThroughDescendants
Field Value
Filter
public static WidgetInput.FilterFunc Filter
Field Value
Properties
CurrentScope
Returns input scope widget with highest priority.
public Widget CurrentScope { get; }
Property Value
LocalMousePosition
[Obsolete("Use Widget.LocalMousePosition()")]
public Vector2 LocalMousePosition { get; }
Property Value
MousePosition
public Vector2 MousePosition { get; }
Property Value
TextInput
public string TextInput { get; }
Property Value
WheelScrollAmount
public float WheelScrollAmount { get; }
Property Value
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
ConsumeKeyRelease(Key)
public bool ConsumeKeyRelease(Key key)
Parameters
key
Key
Returns
ConsumeKeyRepeat(Key)
public bool ConsumeKeyRepeat(Key key)
Parameters
key
Key
Returns
ConsumeKeys(IEnumerable<Key>)
public void ConsumeKeys(IEnumerable<Key> keys)
Parameters
keys
IEnumerable<Key>
ConsumeKeys(List<Key>)
public void ConsumeKeys(List<Key> keys)
Parameters
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
GetNumTouches()
public int GetNumTouches()
Returns
GetTouchPosition(int)
public Vector2 GetTouchPosition(int index)
Parameters
index
int
Returns
IsAcceptingKey(Key)
public bool IsAcceptingKey(Key key)
Parameters
key
Key
Returns
IsAcceptingMouse()
public bool IsAcceptingMouse()
Returns
IsKeyPressed(Key)
public bool IsKeyPressed(Key key)
Parameters
key
Key
Returns
IsMousePressed(int)
public bool IsMousePressed(int button = 0)
Parameters
button
int
Returns
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
WasKeyPressed(Key)
public bool WasKeyPressed(Key key)
Parameters
key
Key
Returns
WasKeyReleased(Key)
public bool WasKeyReleased(Key key)
Parameters
key
Key
Returns
WasKeyRepeated(Key)
public bool WasKeyRepeated(Key key)
Parameters
key
Key
Returns
WasMousePressed(int)
public bool WasMousePressed(int button = 0)
Parameters
button
int
Returns
WasMouseReleased(int)
public bool WasMouseReleased(int button = 0)
Parameters
button
int