Struct KeyBinding
Identifier of a key combination or mouse button for generic input binding.
Assembly: cs.temp.dll.dll
[Serializable]
[Serializable]
public struct KeyBinding
Properties
Type of input this binding maps to.
Declaration
public KeyBinding.KeyType BindingType { get; }
Property Value
Type of input this binding maps to.
Declaration
public KeyBinding.KeyType BindingType { get; }
Property Value
Methods
Create a binding for a keyboard key.
Declaration
public static KeyBinding FromKey(KeyCode keyCode)
Parameters
Type |
Name |
Description |
KeyCode |
keyCode |
|
Returns
Create a binding for a keyboard key.
Declaration
public static KeyBinding FromKey(KeyCode keyCode)
Parameters
Type |
Name |
Description |
KeyCode |
keyCode |
|
Returns
Create a binding for a mouse button.
Declaration
public static KeyBinding FromMouseButton(KeyBinding.MouseButton mouseButton)
Parameters
Returns
Create a binding for a mouse button.
Declaration
public static KeyBinding FromMouseButton(KeyBinding.MouseButton mouseButton)
Parameters
Returns
Create a binding for a mouse button.
Declaration
public static KeyBinding FromMouseButton(int mouseButton)
Parameters
Type |
Name |
Description |
Int32 |
mouseButton |
|
Returns
Create a binding for a mouse button.
Declaration
public static KeyBinding FromMouseButton(int mouseButton)
Parameters
Type |
Name |
Description |
Int32 |
mouseButton |
|
Returns
Declaration
public override string ToString()
Returns
Overrides
Declaration
public override string ToString()
Returns
Overrides
Try to convert the binding to a KeyCode.
Declaration
public bool TryGetKeyCode(out KeyCode keyCode)
Parameters
Type |
Name |
Description |
KeyCode |
keyCode |
|
Returns
Type |
Description |
Boolean |
True if the binding is a keyboard key
|
Try to convert the binding to a KeyCode.
Declaration
public bool TryGetKeyCode(out KeyCode keyCode)
Parameters
Type |
Name |
Description |
KeyCode |
keyCode |
|
Returns
Type |
Description |
Boolean |
True if the binding is a keyboard key
|
Try to convert the binding to a mouse button.
Declaration
public bool TryGetMouseButton(out KeyBinding.MouseButton mouseButton)
Parameters
Returns
Type |
Description |
Boolean |
True if the binding is a mouse button
|
Try to convert the binding to a mouse button.
Declaration
public bool TryGetMouseButton(out KeyBinding.MouseButton mouseButton)
Parameters
Returns
Type |
Description |
Boolean |
True if the binding is a mouse button
|
Try to convert the binding to a mouse button.
Declaration
public bool TryGetMouseButton(out int mouseButton)
Parameters
Type |
Name |
Description |
Int32 |
mouseButton |
|
Returns
Type |
Description |
Boolean |
True if the binding is a mouse button
|
Try to convert the binding to a mouse button.
Declaration
public bool TryGetMouseButton(out int mouseButton)
Parameters
Type |
Name |
Description |
Int32 |
mouseButton |
|
Returns
Type |
Description |
Boolean |
True if the binding is a mouse button
|
Create a default empty binding.
Declaration
public static KeyBinding Unbound()
Returns
Create a default empty binding.
Declaration
public static KeyBinding Unbound()
Returns