Show / Hide Table of Contents

Class KeyboardAndMouse

Good old keyboard and mouse.

This InputDevice you will see primarily on standalone PC, Mac & Linux.

Inheritance
System.Object
InputDevice
KeyboardAndMouse
Inherited Members
InputDevice.ButtonPressedLong
InputDevice.LONG_BUTTON_PRESS_THRESHOLD
InputDevice.IsButtonDown(Int32)
InputDevice.OnEnable()
InputDevice.OnDisable()
InputDevice.ToJson(Boolean)
InputDevice.LoadFromJson(String)
Namespace: GlitchedPolygons.Input
Assembly: UnityScriptsLibrary.dll
Syntax
public class KeyboardAndMouse : InputDevice

Methods

| Improve this Doc View Source

GetAxis(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
InputDevice.GetAxis(Int32)
| Improve this Doc View Source

GetAxisAssociation(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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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").

| Improve this Doc View Source

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 Source

ButtonPressed

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
InputDevice.ButtonPressed
| Improve this Doc View Source

ButtonReleased

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>
Overrides
InputDevice.ButtonReleased
  • Improve this Doc
  • View Source
Back to top Generated by DocFX