Class KeyboardAndMouse
Inherited Members
Namespace: GlitchedPolygons.Input
Assembly: UnityScriptsLibrary.dll
Syntax
public class KeyboardAndMouse : InputDevice
Methods
| Improve this Doc View SourceGetAxis(Int32)
Gets the current value of a game axis.
Declaration
public override float GetAxis(int axisIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | axisIndex | The axis to query (its integer index). |
Returns
| Type | Description |
|---|---|
| System.Single | The current value of the game axis (usually this number is [-1;1] ) |
Overrides
| Improve this Doc View SourceGetAxisAssociation(Int32)
Returns a copy of the specified axis mapping.
Declaration
public KeyboardAndMouse.Axis GetAxisAssociation(int axisIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | axisIndex | The axis whose associated config you want to retrieve. |
Returns
| Type | Description |
|---|---|
| KeyboardAndMouse.Axis | The KeyboardAndMouse.Axis association. |
GetButtonKeys(Int32)
Returns a button's currently assigned KeyCodes.
Declaration
public KeyCode[] GetButtonKeys(int buttonIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | buttonIndex | The button whose mapped KeyCodes you want to retrieve. |
Returns
| Type | Description |
|---|---|
| KeyCode[] | The button's assigned KeyCodes. |
ReassignAxis(Int32, KeyboardAndMouse.Axis)
Reassign an axis.
Declaration
public void ReassignAxis(int axisIndex, KeyboardAndMouse.Axis newAxisAssociation)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | axisIndex | The axis to modify. |
| KeyboardAndMouse.Axis | newAxisAssociation | The new axis mapping. |
ReassignAxis(Int32, String)
Reassign unityAxis.
Declaration
public void ReassignAxis(int axisIndex, string newAxisAssociation)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | axisIndex | The axis to modify. |
| System.String | newAxisAssociation | The new unity axis name (e.g. "Mouse X"). |
ReassignButton(Int32, KeyCode[])
Reassign a button's KeyCodes.
Declaration
public void ReassignButton(int buttonIndex, KeyCode[] newKeys)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | buttonIndex | The button to modify. |
| KeyCode[] | newKeys | The new KeyCodes to remap the button to. |
Events
| Improve this Doc View SourceButtonPressed
This event is raised in the frame where the player presses a button.
Which button was pressed is passed as int argument.
Declaration
public override event Action<int> ButtonPressed
Event Type
| Type | Description |
|---|---|
| System.Action<System.Int32> |
Overrides
| Improve this Doc View SourceButtonReleased
This event is invoked the frame when the user lets go of a button.
Which button was released is passed as int argument.
Declaration
public override event Action<int> ButtonReleased
Event Type
| Type | Description |
|---|---|
| System.Action<System.Int32> |