Input

More information can be found in the Unity API Reference and maybe in the Unity Manual.

Constructors

Constructor

Description

Input()

Methods

Method

Description

ToString()

Static members

Member

Description

acceleration

accelerationEventCount

anyKey

anyKeyDown

backButtonLeavesApp

compensateSensors

compositionCursorPos

compositionString

imeIsSelected

inputString

mousePosition

mousePresent

mouseScrollDelta

mouseSensitivity

The current mouse sensitivity in degrees per mouse unit.

multiTouchEnabled

simulateMouseWithTouches

stylusTouchSupported

touchCount

touchPressureSupported

touchSupported

Details

class Input
Input Input()
string ToString()
static const Vector3 acceleration
static const int accelerationEventCount
static const bool anyKey
static const bool anyKeyDown
static bool backButtonLeavesApp
static bool compensateSensors
static Vector2 compositionCursorPos
static const string compositionString
static const bool imeIsSelected
static const string inputString
static const Vector3 mousePosition
static const bool mousePresent
static const Vector2 mouseScrollDelta
static const float mouseSensitivity

The current mouse sensitivity in degrees per mouse unit. The mouse sensitivity changes depending on current weapon aim zoom level.

static bool multiTouchEnabled
static bool simulateMouseWithTouches
static const bool stylusTouchSupported
static const int touchCount
static const bool touchPressureSupported
static const bool touchSupported
static void DisableNumberRowInputs()

Disables game key bind input from number row keys. This is typically used to get player input from the number keys without triggering a weapon change.

static void EnableNumberRowInputs()

Enables game key bind input from number row keys.

static float GetAxis(string axisName)
static float GetAxisRaw(string axisName)
static bool GetButton(string buttonName)
static bool GetButtonDown(string buttonName)
static bool GetButtonUp(string buttonName)
static array<string> GetJoystickNames()
static bool GetKey(KeyCode key)
static bool GetKey(string name)
static float GetKeyBindAxis(KeyBinds keyBind)

Get key bind as axis. Returns a value between -1 and 1.

static bool GetKeyBindButton(KeyBinds keyBind)

Get key bind as button. Returns true while the button is held down.

static bool GetKeyBindButtonDown(KeyBinds keyBind)

Get key bind as button down. Returns true the frame the button was pressed.

static bool GetKeyBindButtonUp(KeyBinds keyBind)

Get key bind as button up. Returns true the frame the button was released.

static bool GetKeyDown(KeyCode key)
static bool GetKeyDown(string name)
static bool GetKeyUp(KeyCode key)
static bool GetKeyUp(string name)
static bool GetMouseButton(int button)
static bool GetMouseButtonDown(int button)
static bool GetMouseButtonUp(int button)
static void ResetInputAxes()