Struct ControlHandle
- Namespace
- RichHudFramework.UI
- Assembly
- RichHudClient.dll
A unified handle for referencing UI controls.
Abstracts the differences between VRage.Input.MyKeys (Keyboard), RichHudControls (Mouse/Custom), and VRage.Input.MyJoystickButtonsEnum (Gamepad) by wrapping them in a unique integer ID.
public struct ControlHandle
Constructors
ControlHandle(IControl)
public ControlHandle(IControl con)
Parameters
conIControl
ControlHandle(RichHudControls)
public ControlHandle(RichHudControls id)
Parameters
ControlHandle(int)
public ControlHandle(int id)
Parameters
idint
ControlHandle(string)
Creates a handle from a string name (looks up ID via BindManager).
public ControlHandle(string controlName)
Parameters
controlNamestring
ControlHandle(MyJoystickButtonsEnum)
public ControlHandle(MyJoystickButtonsEnum id)
Parameters
idMyJoystickButtonsEnum
ControlHandle(MyKeys)
public ControlHandle(MyKeys id)
Parameters
idMyKeys
Fields
GPKeysStart
The integer index offset where gamepad keys begin.
public const int GPKeysStart = 289
Field Value
id
The unique internal integer ID for this control.
public readonly int id
Field Value
Properties
Control
Retrieves the interface to the underlying IControl object via the BindManager.
public IControl Control { get; }
Property Value
ControlEnum
Returns the RichHudControls enum corresponding to this handle.
public RichHudControls ControlEnum { get; }
Property Value
Methods
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
Operators
explicit operator ControlHandle(int)
public static explicit operator ControlHandle(int con)
Parameters
conint
Returns
implicit operator RichHudControls(ControlHandle)
public static implicit operator RichHudControls(ControlHandle handle)
Parameters
handleControlHandle
Returns
implicit operator int(ControlHandle)
public static implicit operator int(ControlHandle handle)
Parameters
handleControlHandle
Returns
implicit operator MyJoystickButtonsEnum(ControlHandle)
public static implicit operator MyJoystickButtonsEnum(ControlHandle handle)
Parameters
handleControlHandle
Returns
- MyJoystickButtonsEnum
implicit operator MyKeys(ControlHandle)
Implicit conversion to MyKeys. Throws exception if the handle does not represent a valid MyKey.
public static implicit operator MyKeys(ControlHandle handle)
Parameters
handleControlHandle
Returns
- MyKeys
implicit operator ControlHandle(RichHudControls)
public static implicit operator ControlHandle(RichHudControls id)
Parameters
Returns
implicit operator ControlHandle(string)
public static implicit operator ControlHandle(string controlName)
Parameters
controlNamestring
Returns
implicit operator ControlHandle(MyJoystickButtonsEnum)
public static implicit operator ControlHandle(MyJoystickButtonsEnum id)
Parameters
idMyJoystickButtonsEnum
Returns
implicit operator ControlHandle(MyKeys)
public static implicit operator ControlHandle(MyKeys id)
Parameters
idMyKeys