Input
static class in UnityEngine · UnityEngine.InputLegacyModule
Unity's legacy input: keys, mouse buttons, mouse position and virtual axes and buttons. State is sampled once at the start of each frame (FixedUpdate in the same frame sees the same values). Axes are the default project's (ProjectSettings/InputManager.asset), keyboard and mouse entries; smoothing follows their gravity, sensitivity, dead zone and snap settings.
Properties 16
static Vector3 acceleration { get; }static bool anyKey { get; }static bool anyKeyDown { get; }static Vector2 compositionCursorPos { get; set; }static string compositionString { get; }Text being composed by an input method editor (none yet).
static IMECompositionMode imeCompositionMode { get; set; }static bool imeIsSelected { get; }static string inputString { get; }Typed text this frame (not reported yet).
static Vector3 mousePosition { get; }The mouse in screen pixels, bottom-left origin (z is 0).
static bool mousePresent { get; }static Vector2 mouseScrollDelta { get; }static bool multiTouchEnabled { get; set; }static bool simulateMouseWithTouches { get; set; }static int touchCount { get; }static bool touchSupported { get; }static Touch[] touches { get; }Methods 14
static float GetAxis(string axisName)The smoothed value of a virtual axis, in [-1, 1] for key axes.
static float GetAxisRaw(string axisName)The unsmoothed value: -1, 0 or 1 for key axes.
static bool GetButton(string buttonName)static bool GetButtonDown(string buttonName)static bool GetButtonUp(string buttonName)static string[] GetJoystickNames()The connected controllers' names, in the order the joystick numbers count them.
static bool GetKey(KeyCode key)static bool GetKey(string name)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 Touch GetTouch(int index)static void ResetInputAxes()Recenters every axis (they rise again from zero).
Not in Tassix yet 19
(constructor) ClearLastPenContactEvent GetAccelerationEvent GetLastPenContactEvent GetPenEvent IsJoystickPreconfigured ResetPenEvents accelerationEventCount accelerationEvents backButtonLeavesApp compass compensateSensors deviceOrientation gyro location mousePositionDelta penEventCount stylusTouchSupported touchPressureSupported
Checked against Unity
Conformance scenarios that exercise it, recorded in Unity and compared event by event.