docs.unity3d.com
  • Manual
  • Scripting API
  • Changelog
  • License
Search Results for

    Show / Hide Table of Contents
    • UnityEngine.InputSystem
      • Accelerometer
      • AmbientTemperatureSensor
      • AssetDatabaseUtils
      • AttitudeSensor
      • CommonUsages
      • DefaultInputActions
      • DefaultInputActions.IPlayerActions
      • DefaultInputActions.IUIActions
      • DefaultInputActions.PlayerActions
      • DefaultInputActions.UIActions
      • Gamepad
      • GravitySensor
      • Gyroscope
      • HingeAngle
      • HumiditySensor
      • IInputActionCollection
      • IInputActionCollection2
      • IInputInteraction
      • IInputInteraction<TValue>
      • InputAction
      • InputAction.CallbackContext
      • InputActionAsset
      • InputActionChange
      • InputActionMap
      • InputActionPhase
      • InputActionProperty
      • InputActionRebindingExtensions
      • InputActionRebindingExtensions.RebindingOperation
      • InputActionReference
      • InputActionSetupExtensions
      • InputActionSetupExtensions.BindingSyntax
      • InputActionSetupExtensions.CompositeSyntax
      • InputActionSetupExtensions.ControlSchemeSyntax
      • InputActionType
      • InputBinding
      • InputBinding.DisplayStringOptions
      • InputBindingComposite
      • InputBindingCompositeContext
      • InputBindingCompositeContext.PartBinding
      • InputBindingComposite<TValue>
      • InputControl
      • InputControlExtensions
      • InputControlExtensions.Enumerate
      • InputControlExtensions.InputEventControlCollection
      • InputControlExtensions.InputEventControlEnumerator
      • InputControlLayoutChange
      • InputControlList<TControl>
      • InputControlPath
      • InputControlPath.HumanReadableStringOptions
      • InputControlPath.ParsedPathComponent
      • InputControlScheme
      • InputControlScheme.DeviceRequirement
      • InputControlScheme.MatchResult
      • InputControlScheme.MatchResult.Match
      • InputControl<TValue>
      • InputDevice
      • InputDeviceChange
      • InputExtensions
      • InputInteractionContext
      • InputProcessor
      • InputProcessor.CachingPolicy
      • InputProcessor<TValue>
      • InputRemoting
      • InputRemoting.Message
      • InputRemoting.MessageType
      • InputSettings
      • InputSettings.BackgroundBehavior
      • InputSettings.EditorInputBehaviorInPlayMode
      • InputSettings.InputActionPropertyDrawerMode
      • InputSettings.ScrollDeltaBehavior
      • InputSettings.UpdateMode
      • InputSettings.iOSSettings
      • InputSystem
      • InputTestFixture
      • InputTestFixture.ActionConstraint
      • InputTestFixture.AnalyticsEventData
      • InputTestFixture.AnalyticsRegistrationEventData
      • InputValue
      • Joystick
      • Key
      • Keyboard
      • LightSensor
      • LinearAccelerationSensor
      • MagneticFieldSensor
      • Mouse
      • Pen
      • PenButton
      • PlayerInput
      • PlayerInput.ActionEvent
      • PlayerInput.ControlsChangedEvent
      • PlayerInput.DeviceLostEvent
      • PlayerInput.DeviceRegainedEvent
      • PlayerInputManager
      • PlayerInputManager.PlayerJoinedEvent
      • PlayerInputManager.PlayerLeftEvent
      • PlayerJoinBehavior
      • PlayerNotifications
      • Pointer
      • PressureSensor
      • ProximitySensor
      • Sensor
      • StepCounter
      • TouchPhase
      • Touchscreen
      • TrackedDevice
    • UnityEngine.InputSystem.Android
      • AndroidAccelerometer
      • AndroidAmbientTemperature
      • AndroidGameRotationVector
      • AndroidGamepad
      • AndroidGamepadWithDpadAxes
      • AndroidGamepadWithDpadButtons
      • AndroidGravitySensor
      • AndroidGyroscope
      • AndroidHingeAngle
      • AndroidJoystick
      • AndroidLightSensor
      • AndroidLinearAccelerationSensor
      • AndroidMagneticFieldSensor
      • AndroidPressureSensor
      • AndroidProximity
      • AndroidRelativeHumidity
      • AndroidRotationVector
      • AndroidStepCounter
      • DualShock4GamepadAndroid
      • XboxOneGamepadAndroid
    • UnityEngine.InputSystem.Android.LowLevel
      • AndroidAxis
      • AndroidGameControllerState
      • AndroidGameControllerState.Variants
      • AndroidKeyCode
    • UnityEngine.InputSystem.Composites
      • AxisComposite
      • AxisComposite.WhichSideWins
      • ButtonWithOneModifier
      • ButtonWithOneModifier.ModifiersOrder
      • ButtonWithTwoModifiers
      • ButtonWithTwoModifiers.ModifiersOrder
      • OneModifierComposite
      • OneModifierComposite.ModifiersOrder
      • TwoModifiersComposite
      • TwoModifiersComposite.ModifiersOrder
      • Vector2Composite
      • Vector2Composite.Mode
      • Vector3Composite
      • Vector3Composite.Mode
    • UnityEngine.InputSystem.Controls
      • AnyKeyControl
      • AxisControl
      • AxisControl.Clamp
      • ButtonControl
      • DeltaControl
      • DiscreteButtonControl
      • DiscreteButtonControl.WriteMode
      • DoubleControl
      • DpadControl
      • DpadControl.DpadAxisControl
      • IntegerControl
      • KeyControl
      • QuaternionControl
      • StickControl
      • TouchControl
      • TouchPhaseControl
      • TouchPressControl
      • Vector2Control
      • Vector3Control
    • UnityEngine.InputSystem.DualShock
      • DualSenseGamepadHID
      • DualShock3GamepadHID
      • DualShock4GamepadHID
      • DualShockGamepad
      • IDualShockHaptics
    • UnityEngine.InputSystem.DualShock.LowLevel
      • DualSenseHIDInputReport
    • UnityEngine.InputSystem.Editor
      • InputActionCodeGenerator
      • InputActionCodeGenerator.Options
      • InputControlPathEditor
      • InputControlPicker
      • InputControlPicker.Mode
      • InputControlPickerState
      • InputParameterEditor
      • InputParameterEditor<TObject>
      • InputSystemPluginControl
    • UnityEngine.InputSystem.EnhancedTouch
      • EnhancedTouchSupport
      • Finger
      • Touch
      • TouchHistory
      • TouchSimulation
    • UnityEngine.InputSystem.HID
      • HID
      • HID.Button
      • HID.GenericDesktop
      • HID.HIDCollectionDescriptor
      • HID.HIDCollectionType
      • HID.HIDDeviceDescriptor
      • HID.HIDDeviceDescriptorBuilder
      • HID.HIDElementDescriptor
      • HID.HIDElementFlags
      • HID.HIDReportType
      • HID.Simulation
      • HID.UsagePage
      • HIDSupport
      • HIDSupport.HIDPageUsage
    • UnityEngine.InputSystem.Haptics
      • IDualMotorRumble
      • IHaptics
    • UnityEngine.InputSystem.Interactions
      • HoldInteraction
      • MultiTapInteraction
      • PressBehavior
      • PressInteraction
      • SlowTapInteraction
      • TapInteraction
    • UnityEngine.InputSystem.Layouts
      • InputControlAttribute
      • InputControlLayout
      • InputControlLayout.Builder
      • InputControlLayout.Builder.ControlBuilder
      • InputControlLayout.ControlItem
      • InputControlLayout.LayoutNotFoundException
      • InputControlLayoutAttribute
      • InputDeviceDescription
      • InputDeviceFindControlLayoutDelegate
      • InputDeviceMatcher
    • UnityEngine.InputSystem.LowLevel
      • DeltaStateEvent
      • DeviceConfigurationEvent
      • DeviceRemoveEvent
      • DeviceResetEvent
      • DisableDeviceCommand
      • EnableDeviceCommand
      • EnableIMECompositionCommand
      • GamepadButton
      • GamepadState
      • IInputDeviceCommandInfo
      • IInputEventTypeInfo
      • IInputStateCallbackReceiver
      • IInputStateChangeMonitor
      • IInputStateTypeInfo
      • IInputUpdateCallbackReceiver
      • IMECompositionEvent
      • IMECompositionString
      • ITextInputReceiver
      • InitiateUserAccountPairingCommand
      • InitiateUserAccountPairingCommand.Result
      • InputDeviceCommand
      • InputDeviceCommandDelegate
      • InputDeviceExecuteCommandDelegate
      • InputEvent
      • InputEventBuffer
      • InputEventListener
      • InputEventPtr
      • InputEventTrace
      • InputEventTrace.DeviceInfo
      • InputEventTrace.ReplayController
      • InputMetrics
      • InputState
      • InputStateBlock
      • InputStateHistory
      • InputStateHistory.Record
      • InputStateHistory.RecordHeader
      • InputStateHistory<TValue>
      • InputStateHistory<TValue>.Record
      • InputUpdateType
      • KeyboardState
      • MouseButton
      • MouseState
      • PenState
      • QueryCanRunInBackground
      • QueryDimensionsCommand
      • QueryEnabledStateCommand
      • QueryKeyNameCommand
      • QueryKeyboardLayoutCommand
      • QueryPairedUserAccountCommand
      • QueryPairedUserAccountCommand.Result
      • RequestResetCommand
      • RequestSyncCommand
      • SetIMECursorPositionCommand
      • SetSamplingFrequencyCommand
      • StateEvent
      • TextEvent
      • TouchState
    • UnityEngine.InputSystem.OSX
      • NimbusGamepadHid
    • UnityEngine.InputSystem.OnScreen
      • OnScreenButton
      • OnScreenControl
      • OnScreenStick
      • OnScreenStick.Behaviour
    • UnityEngine.InputSystem.Processors
      • AxisDeadzoneProcessor
      • ClampProcessor
      • EditorWindowSpaceProcessor
      • InvertProcessor
      • InvertVector2Processor
      • InvertVector3Processor
      • NormalizeProcessor
      • NormalizeVector2Processor
      • NormalizeVector3Processor
      • ScaleProcessor
      • ScaleVector2Processor
      • ScaleVector3Processor
      • StickDeadzoneProcessor
    • UnityEngine.InputSystem.Switch
      • SwitchProControllerHID
    • UnityEngine.InputSystem.UI
      • ExtendedPointerEventData
      • InputSystemUIInputModule
      • InputSystemUIInputModule.CursorLockBehavior
      • MultiplayerEventSystem
      • TrackedDeviceRaycaster
      • UIPointerBehavior
      • UIPointerType
      • VirtualMouseInput
      • VirtualMouseInput.CursorMode
    • UnityEngine.InputSystem.Users
      • InputUser
      • InputUser.ControlSchemeChangeSyntax
      • InputUserAccountHandle
      • InputUserChange
      • InputUserPairingOptions
    • UnityEngine.InputSystem.Utilities
      • DisplayStringFormatAttribute
      • FourCC
      • InputActionTrace
      • InputActionTrace.ActionEventPtr
      • InternedString
      • NameAndParameters
      • NamedValue
      • Observable
      • PrimitiveValue
      • ReadOnlyArrayExtensions
      • ReadOnlyArray<TValue>
      • ReadOnlyArray<TValue>.Enumerator
      • Vector2MagnitudeComparer
      • Vector3MagnitudeComparer
    • UnityEngine.InputSystem.WebGL
      • WebGLGamepad
      • WebGLJoystick
    • UnityEngine.InputSystem.XInput
      • IXboxOneRumble
      • XInputController
      • XInputController.DeviceFlags
      • XInputController.DeviceSubType
      • XInputControllerWindows
      • XboxGamepadMacOS
      • XboxGamepadMacOSWireless
      • XboxOneGampadMacOSWireless
    • UnityEngine.InputSystem.XR
      • Bone
      • BoneControl
      • Eyes
      • EyesControl
      • FeatureType
      • PoseControl
      • PoseState
      • TrackedPoseDriver
      • TrackedPoseDriver.TrackingType
      • TrackedPoseDriver.UpdateType
      • UsageHint
      • XRController
      • XRControllerWithRumble
      • XRDeviceDescriptor
      • XRFeatureDescriptor
      • XRHMD
      • XRUtilities
    • UnityEngine.InputSystem.XR.Haptics
      • BufferedRumble
      • GetCurrentHapticStateCommand
      • GetHapticCapabilitiesCommand
      • HapticCapabilities
      • HapticState
      • SendBufferedHapticCommand
      • SendHapticImpulseCommand
    • UnityEngine.InputSystem.iOS
      • DualSenseGampadiOS
      • DualShock4GampadiOS
      • PrivacyDataUsage
      • XboxOneGampadiOS
      • iOSGameController
    • UnityEngine.InputSystem.iOS.LowLevel
      • MotionAuthorizationStatus
      • iOSStepCounter
    • Scripting API
    • UnityEngine.InputSystem
    • Keyboard

    Class Keyboard

    Represents a standard, physical PC-type keyboard.

    Inheritance
    object
    InputControl
    InputDevice
    Keyboard
    Implements
    ITextInputReceiver
    Inherited Members
    InputDevice.InvalidDeviceId
    InputDevice.description
    InputDevice.enabled
    InputDevice.canRunInBackground
    InputDevice.added
    InputDevice.remote
    InputDevice.native
    InputDevice.updateBeforeRender
    InputDevice.deviceId
    InputDevice.lastUpdateTime
    InputDevice.wasUpdatedThisFrame
    InputDevice.allControls
    InputDevice.valueType
    InputDevice.valueSizeInBytes
    InputDevice.ReadValueFromBufferAsObject(void*, int)
    InputDevice.ReadValueFromStateAsObject(void*)
    InputDevice.ReadValueFromStateIntoBuffer(void*, void*, int)
    InputDevice.CompareValue(void*, void*)
    InputDevice.OnAdded()
    InputDevice.OnConfigurationChanged()
    InputDevice.ExecuteCommand<TCommand>(ref TCommand)
    InputDevice.ExecuteCommand(InputDeviceCommand*)
    InputControl.name
    InputControl.displayName
    InputControl.shortDisplayName
    InputControl.path
    InputControl.layout
    InputControl.variants
    InputControl.device
    InputControl.parent
    InputControl.children
    InputControl.usages
    InputControl.aliases
    InputControl.stateBlock
    InputControl.noisy
    InputControl.synthetic
    InputControl.this[string]
    InputControl.magnitude
    InputControl.ToString()
    InputControl.EvaluateMagnitude()
    InputControl.EvaluateMagnitude(void*)
    InputControl.WriteValueFromBufferIntoState(void*, int, void*)
    InputControl.WriteValueFromObjectIntoState(object, void*)
    InputControl.TryGetChildControl(string)
    InputControl.TryGetChildControl<TControl>(string)
    InputControl.GetChildControl(string)
    InputControl.GetChildControl<TControl>(string)
    InputControl.RefreshConfigurationIfNeeded()
    InputControl.m_StateBlock
    InputControl.currentStatePtr
    InputControl.previousFrameStatePtr
    InputControl.defaultStatePtr
    InputControl.noiseMaskPtr
    InputControl.stateOffsetRelativeToDeviceRoot
    InputControl.optimizedControlDataType
    InputControl.CalculateOptimizedControlDataType()
    InputControl.ApplyParameterChanges()
    Namespace: UnityEngine.InputSystem
    Assembly: Unity.InputSystem.dll
    Syntax
    public class Keyboard : InputDevice, ITextInputReceiver
    Remarks

    Keyboards allow for both individual button input as well as text input. To receive button input, use the individual KeyControl-type controls present on the keyboard. For example, aKey. To receive text input, use the onTextInput callback.

    The naming/identification of keys is agnostic to keyboard layouts. This means that aKey, for example, will always be the key to the right of capsLockKey regardless of where the current keyboard language layout puts the "a" character. This also means that having a binding to "<Keyboard>/a" on an InputAction, for example, will bind to the same key regardless of locale -- an important feature, for example, for getting stable WASD bindings.

    To find what text character (if any) is produced by a key, you can use the key's displayName property. This can also be used in bindings. "<Keyboard>/#(a)", for example, will bind to the key that produces the "a" character according to the currently active keyboard layout.

    To find out which keyboard layout is currently active, you can use the keyboardLayout property. Note that keyboard layout names are platform-dependent.

    Note that keyboard devices will always have key controls added for all keys in the Key enumeration -- whether they are actually present on the physical keyboard or not. It is thus not possible to find out this way whether the underlying keyboard has certain keys or not.

    Examples
    using UnityEngine;
    using UnityEngine.InputSystem;
    
    public class InputExample : MonoBehaviour
    {
        private string inputText = "";
        void Start()
        {
            Keyboard.current.onTextInput += OnTextInput;
        }
        void Update()
        {
            // Check whether the A key on the current keyboard is pressed.
            if (Keyboard.current.aKey.wasPressedThisFrame)
                Debug.Log("A Key pressed");
        }
        private void OnTextInput(char ch)
        {
            inputText += ch;
        }
    }

    Fields

    KeyCount

    Total number of key controls on a keyboard, i.e. the number of controls in allKeys.

    Declaration
    public const int KeyCount = 110
    Field Value
    Type Description
    int

    Total number of key controls.

    See Also
    InputDevice

    Properties

    this[Key]

    Look up a key control by its key code.

    Declaration
    public KeyControl this[Key key] { get; }
    Parameters
    Type Name Description
    Key key

    Key code of key control to return.

    Property Value
    Type Description
    KeyControl
    Remarks

    This is equivalent to allKeys[(int)key - 1].

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    The given key is not valid.

    See Also
    InputDevice

    aKey

    The 'a' key. The key immediately to the right of capsLockKey.

    Declaration
    public KeyControl aKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the a key.

    See Also
    InputDevice

    allKeys

    List of all key controls on the keyboard.

    Declaration
    public ReadOnlyArray<KeyControl> allKeys { get; }
    Property Value
    Type Description
    ReadOnlyArray<KeyControl>
    See Also
    InputDevice

    altKey

    An artificial combination of leftAltKey and rightAltKey into one control.

    Declaration
    public ButtonControl altKey { get; protected set; }
    Property Value
    Type Description
    ButtonControl
    Remarks

    ButtonControl representing a combined left and right alt key.

    This is a synthetic button which is considered pressed whenever the left and/or right alt key is pressed.

    See Also
    InputDevice

    anyKey

    A synthetic button control that is considered pressed if any key on the keyboard is pressed.

    Declaration
    public AnyKeyControl anyKey { get; protected set; }
    Property Value
    Type Description
    AnyKeyControl
    Remarks

    AnyKeyControl representing the synthetic "anyKey".

    See Also
    InputDevice

    bKey

    The 'b' key. The key in-between the vKey to the left and the nKey to the right in the bottom-most row of alphabetic characters.

    Declaration
    public KeyControl bKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the b key.

    See Also
    InputDevice

    backquoteKey

    The ` key. The leftmost key in the row of digits. Directly above tabKey.

    Declaration
    public KeyControl backquoteKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the backtick/quote key.

    See Also
    InputDevice

    backslashKey

    The '' key. The key immediately to the right of rightBracketKey and next to or above enterKey.

    Declaration
    public KeyControl backslashKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the backslash key.

    See Also
    InputDevice

    backspaceKey

    The backspace key (usually labeled "delete" on Mac). The rightmost key in the top digit row with equalsKey to the left.

    Declaration
    public KeyControl backspaceKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the backspace key.

    On the Mac, this key may be labeled "delete" which however is a key different from deleteKey.

    See Also
    InputDevice

    cKey

    The 'c' key. The key in-between the xKey to the left and the vKey to the right in the bottom-most row of alphabetic characters.

    Declaration
    public KeyControl cKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the c key.

    See Also
    InputDevice

    capsLockKey

    The Caps Lock key. The key below tabKey and above leftShiftKey.

    Declaration
    public KeyControl capsLockKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the caps lock key.

    See Also
    InputDevice

    commaKey

    The ',' key. Third key to the left of rightShiftKey.

    Declaration
    public KeyControl commaKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the comma key.

    See Also
    InputDevice

    contextMenuKey

    The context menu key. This key is generally only found on PC keyboards. If present, it is located in-between the rightWindowsKey and the rightCtrlKey. It brings up the context menu according to the current selection.

    Declaration
    public KeyControl contextMenuKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the context menu key.

    See Also
    InputDevice

    ctrlKey

    An artificial combination of leftCtrlKey and rightCtrlKey into one control.

    Declaration
    public ButtonControl ctrlKey { get; protected set; }
    Property Value
    Type Description
    ButtonControl
    Remarks

    ButtonControl representing a combined left and right ctrl key.

    This is a synthetic button which is considered pressed whenever the left and/or right ctrl key is pressed.

    See Also
    InputDevice

    current

    The keyboard that was last used or added. Null if there is no keyboard.

    Declaration
    public static Keyboard current { get; }
    Property Value
    Type Description
    Keyboard
    See Also
    InputDevice

    dKey

    The 'd' key. The key in-between the sKey to the left and the fKey to the right in the middle row of alphabetic characters.

    Declaration
    public KeyControl dKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the d key.

    See Also
    InputDevice

    deleteKey

    The 'delete' key. Usually in a separate block with endKey to its right and insertKey sitting above it.

    Declaration
    public KeyControl deleteKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the delete key.

    On the Mac, the backspaceKey is also labeled "delete". However, this is not this key.

    See Also
    InputDevice

    digit0Key

    The '0' key. The key in-between the digit9Key to the left and the minusKey to the right in the row of digit characters.

    Declaration
    public KeyControl digit0Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the 0 key.

    See Also
    InputDevice

    digit1Key

    The '1' key. The key in-between the backquoteKey to the left and the digit2Key to the right in the row of digit characters.

    Declaration
    public KeyControl digit1Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the 1 key.

    See Also
    InputDevice

    digit2Key

    The '2' key. The key in-between the digit1Key to the left and the digit3Key to the right in the row of digit characters.

    Declaration
    public KeyControl digit2Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the 2 key.

    See Also
    InputDevice

    digit3Key

    The '3' key. The key in-between the digit2Key to the left and the digit4Key to the right in the row of digit characters.

    Declaration
    public KeyControl digit3Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the 3 key.

    See Also
    InputDevice

    digit4Key

    The '4' key. The key in-between the digit3Key to the left and the digit5Key to the right in the row of digit characters.

    Declaration
    public KeyControl digit4Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the 4 key.

    See Also
    InputDevice

    digit5Key

    The '5' key. The key in-between the digit4Key to the left and the digit6Key to the right in the row of digit characters.

    Declaration
    public KeyControl digit5Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the 5 key.

    See Also
    InputDevice

    digit6Key

    The '6' key. The key in-between the digit5Key to the left and the digit7Key to the right in the row of digit characters.

    Declaration
    public KeyControl digit6Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the 6 key.

    See Also
    InputDevice

    digit7Key

    The '7' key. The key in-between the digit6Key to the left and the digit8Key to the right in the row of digit characters.

    Declaration
    public KeyControl digit7Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the 7 key.

    See Also
    InputDevice

    digit8Key

    The '8' key. The key in-between the digit7Key to the left and the digit9Key to the right in the row of digit characters.

    Declaration
    public KeyControl digit8Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the 8 key.

    See Also
    InputDevice

    digit9Key

    The '9' key. The key in-between the digit8Key to the left and the digit0Key to the right in the row of digit characters.

    Declaration
    public KeyControl digit9Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the 9 key.

    See Also
    InputDevice

    downArrowKey

    The down arrow key. Usually in a block by itself and generally below the upArrowKey and in-between leftArrowKey to the left and rightArrowKey to the right.

    Declaration
    public KeyControl downArrowKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the down arrow key.

    See Also
    InputDevice

    eKey

    The 'e' key. The key in-between the wKey to the left and the rKey to the right in the topmost row of alphabetic characters.

    Declaration
    public KeyControl eKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the e key.

    See Also
    InputDevice

    endKey

    The 'end' key. Usually in a separate block with deleteKey to the left and pageDownKey to the right.

    Declaration
    public KeyControl endKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the end key.

    See Also
    InputDevice

    enterKey

    The enter/return key in the main key block.

    Declaration
    public KeyControl enterKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the enter key. This key is distinct from the enter key on the numpad which is numpadEnterKey.

    See Also
    InputDevice

    equalsKey

    The '=' key in the main key block. The key in-between minusKey to the left and backspaceKey to the right.

    Declaration
    public KeyControl equalsKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the equals key.

    See Also
    InputDevice

    escapeKey

    The escape key, i.e. the key generally in the top left corner of the keyboard. Usually to the left of f1Key.

    Declaration
    public KeyControl escapeKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the escape key.

    See Also
    InputDevice

    f10Key

    The F10 key. The key in-between f9Key to the left and f11Key to the right in the topmost row of keys.

    Declaration
    public KeyControl f10Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the F10 key.

    See Also
    InputDevice

    f11Key

    The F11 key. The key in-between f10Key to the left and f12Key to the right in the topmost row of keys.

    Declaration
    public KeyControl f11Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the F11 key.

    See Also
    InputDevice

    f12Key

    The F12 key. The key in-between f11Key to the left and printScreenKey to the right in the topmost row of keys.

    Declaration
    public KeyControl f12Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the F12 key.

    See Also
    InputDevice

    f13Key

    The F13 key on the keyboard

    Declaration
    public KeyControl f13Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing F13. Keyboards may have additional Functions keys that are not part of the standardized 104-key keyboard layout

    See Also
    InputDevice

    f14Key

    The F14 key on the keyboard

    Declaration
    public KeyControl f14Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing F14. Keyboards may have additional Functions keys that are not part of the standardized 104-key keyboard layout

    See Also
    InputDevice

    f15Key

    The F15 key on the keyboard

    Declaration
    public KeyControl f15Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing F15. Keyboards may have additional Functions keys that are not part of the standardized 104-key keyboard layout

    See Also
    InputDevice

    f16Key

    The F16 key on the keyboard

    Declaration
    public KeyControl f16Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing F16. Keyboards may have additional Functions keys that are not part of the standardized 104-key keyboard layout

    See Also
    InputDevice

    f17Key

    The F17 key on the keyboard

    Declaration
    public KeyControl f17Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing F17. Keyboards may have additional Functions keys that are not part of the standardized 104-key keyboard layout

    See Also
    InputDevice

    f18Key

    The F18 key on the keyboard

    Declaration
    public KeyControl f18Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing F18. Keyboards may have additional Functions keys that are not part of the standardized 104-key keyboard layout

    See Also
    InputDevice

    f19Key

    The F19 key on the keyboard

    Declaration
    public KeyControl f19Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing F19. Keyboards may have additional Functions keys that are not part of the standardized 104-key keyboard layout

    See Also
    InputDevice

    f1Key

    The F1 key. The key in-between escapeKey to the left and f1Key to the right in the topmost row of keys.

    Declaration
    public KeyControl f1Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the F1 key.

    See Also
    InputDevice

    f20Key

    The F20 key on the keyboard

    Declaration
    public KeyControl f20Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing F20. Keyboards may have additional Functions keys that are not part of the standardized 104-key keyboard layout

    See Also
    InputDevice

    f21Key

    The F21 key on the keyboard

    Declaration
    public KeyControl f21Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing F21. Keyboards may have additional Functions keys that are not part of the standardized 104-key keyboard layout

    See Also
    InputDevice

    f22Key

    The F22 key on the keyboard

    Declaration
    public KeyControl f22Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing F22. Keyboards may have additional Functions keys that are not part of the standardized 104-key keyboard layout

    See Also
    InputDevice

    f23Key

    The F23 key on the keyboard

    Declaration
    public KeyControl f23Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing F23. Keyboards may have additional Functions keys that are not part of the standardized 104-key keyboard layout

    See Also
    InputDevice

    f24Key

    The F24 key on the keyboard

    Declaration
    public KeyControl f24Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing F24. Keyboards may have additional Functions keys that are not part of the standardized 104-key keyboard layout

    See Also
    InputDevice

    f2Key

    The F2 key. The key in-between f1Key to the left and f3Key to the right in the topmost row of keys.

    Declaration
    public KeyControl f2Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the F2 key.

    See Also
    InputDevice

    f3Key

    The F3 key. The key in-between f2Key to the left and f4Key to the right in the topmost row of keys.

    Declaration
    public KeyControl f3Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the F3 key.

    See Also
    InputDevice

    f4Key

    The F4 key. The key in-between f3Key to the left and f5Key to the right in the topmost row of keys.

    Declaration
    public KeyControl f4Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the F4 key.

    See Also
    InputDevice

    f5Key

    The F5 key. The key in-between f4Key to the left and f6Key to the right in the topmost row of keys.

    Declaration
    public KeyControl f5Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the F5 key.

    See Also
    InputDevice

    f6Key

    The F6 key. The key in-between f5Key to the left and f7Key to the right in the topmost row of keys.

    Declaration
    public KeyControl f6Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the F6 key.

    See Also
    InputDevice

    f7Key

    The F7 key. The key in-between f6Key to the left and f8Key to the right in the topmost row of keys.

    Declaration
    public KeyControl f7Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the F7 key.

    See Also
    InputDevice

    f8Key

    The F8 key. The key in-between f7Key to the left and f9Key to the right in the topmost row of keys.

    Declaration
    public KeyControl f8Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the F8 key.

    See Also
    InputDevice

    f9Key

    The F9 key. The key in-between f8Key to the left and f10Key to the right in the topmost row of keys.

    Declaration
    public KeyControl f9Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the F9 key.

    See Also
    InputDevice

    fKey

    The 'f' key. The key in-between the dKey to the left and the gKey to the right in the middle row of alphabetic characters.

    Declaration
    public KeyControl fKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the f key.

    See Also
    InputDevice

    gKey

    The 'g' key. The key in-between the fKey to the left and the hKey to the right in the middle row of alphabetic characters.

    Declaration
    public KeyControl gKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the g key.

    See Also
    InputDevice

    hKey

    The 'h' key. The key in-between the gKey to the left and the jKey to the right in the middle row of alphabetic characters.

    Declaration
    public KeyControl hKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the h key.

    See Also
    InputDevice

    homeKey

    The 'home' key. Usually in a separate block with pageUpKey to the right and insertKey to the left.

    Declaration
    public KeyControl homeKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the insert key.

    See Also
    InputDevice

    iKey

    The 'i' key. The key in-between the uKey to the left and the oKey to the right in the top row of alphabetic characters.

    Declaration
    public KeyControl iKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the i key.

    See Also
    InputDevice

    imeSelected

    True when IME composition is enabled. Requires SetIMEEnabled(bool) to be called to enable IME, and the user to enable it at the OS level.

    Declaration
    public ButtonControl imeSelected { get; protected set; }
    Property Value
    Type Description
    ButtonControl
    Remarks

    Some languages use complex input methods which involve opening windows to insert characters. Typically, this is not desirable while playing a game, as games may just interpret keystrokes as game input, not as text.

    See SetIMEEnabled(bool) for turning IME on/off

    See Also
    InputDevice

    insertKey

    The 'insert' key. Usually in a separate block with homeKey to its right and deleteKey sitting below it.

    Declaration
    public KeyControl insertKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the insert key.

    See Also
    InputDevice

    jKey

    The 'j' key. The key in-between the hKey to the left and the kKey to the right in the middle row of alphabetic characters.

    Declaration
    public KeyControl jKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the j key.

    See Also
    InputDevice

    kKey

    The 'k' key. The key in-between the jKey to the left and the lKey to the right in the middle row of alphabetic characters.

    Declaration
    public KeyControl kKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the k key.

    See Also
    InputDevice

    keyboardLayout

    The name of the layout currently used by the keyboard.

    Declaration
    public string keyboardLayout { get; protected set; }
    Property Value
    Type Description
    string
    Remarks

    Note that keyboard layout names are platform-specific.

    The value of this property reflects the currently used layout and thus changes whenever the layout of the system or the one for the application is changed.

    To determine what a key represents in the current layout, use displayName.

    See Also
    InputDevice

    keys

    Raw array of key controls on the keyboard.

    Declaration
    protected KeyControl[] keys { get; set; }
    Property Value
    Type Description
    KeyControl[]
    See Also
    InputDevice

    lKey

    The 'l' key. The key in-between the kKey to the left and the semicolonKey to the right in the middle row of alphabetic characters.

    Declaration
    public KeyControl lKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the l key.

    See Also
    InputDevice

    leftAltKey

    The alt/option key on the left side of the keyboard.

    Declaration
    public KeyControl leftAltKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the left alt/option key.

    See Also
    InputDevice

    leftAppleKey

    Same as leftMetaKey. Apple/command system key on left side of keyboard.

    Declaration
    public KeyControl leftAppleKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the left Apple/command system key.

    See Also
    InputDevice

    leftArrowKey

    The left arrow key. Usually in a block by itself and generally to the left of downArrowKey.

    Declaration
    public KeyControl leftArrowKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the left arrow key.

    See Also
    InputDevice

    leftBracketKey

    The '[' key. The key immediately to the left of rightBracketKey.

    Declaration
    public KeyControl leftBracketKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the left bracket key.

    See Also
    InputDevice

    leftCommandKey

    Same as leftMetaKey. Apple/command system key on left side of keyboard.

    Declaration
    public KeyControl leftCommandKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the left Apple/command system key.

    See Also
    InputDevice

    leftCtrlKey

    The control/ctrl key on the left side of the keyboard.

    Declaration
    public KeyControl leftCtrlKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the left control key.

    See Also
    InputDevice

    leftMetaKey

    The system "meta" key (Windows key on PC, Apple/command key on Mac) on the left side of the keyboard.

    Declaration
    public KeyControl leftMetaKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the left system meta key.

    See Also
    InputDevice

    leftShiftKey

    The shift key on the left side of the keyboard.

    Declaration
    public KeyControl leftShiftKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the left shift key.

    See Also
    InputDevice

    leftWindowsKey

    Same as leftMetaKey. Windows system key on left side of keyboard.

    Declaration
    public KeyControl leftWindowsKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the left Windows system key.

    See Also
    InputDevice

    mKey

    The 'm' key. The key in-between the nKey to the left and the commaKey to the right in the bottom row of alphabetic characters.

    Declaration
    public KeyControl mKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the m key.

    See Also
    InputDevice

    minusKey

    The '-' key. The second key to the left of backspaceKey.

    Declaration
    public KeyControl minusKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the minus key.

    See Also
    InputDevice

    nKey

    The 'n' key. The key in-between the bKey to the left and the mKey to the right in the bottom row of alphabetic characters.

    Declaration
    public KeyControl nKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the n key.

    See Also
    InputDevice

    numLockKey

    The Num Lock key. The key sitting in the top left corner of the numpad and which usually toggles the numpad between generating digits and triggering functions like "insert" etc. instead.

    Declaration
    public KeyControl numLockKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the num lock key.

    See Also
    InputDevice

    numpad0Key

    The 0 key on the numpad. The key in the bottom left corner of the numpad. Usually and elongated key.

    Declaration
    public KeyControl numpad0Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the numpad 0 key.

    See Also
    InputDevice

    numpad1Key

    The 1 key on the numpad. The key on the left side of the numpad with numpad0Key below it and numpad4Key above it.

    Declaration
    public KeyControl numpad1Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the numpad 1 key.

    See Also
    InputDevice

    numpad2Key

    The 2 key on the numpad. The key with the numpad1Key to its left and the numpad3Key to its right.

    Declaration
    public KeyControl numpad2Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the numpad 2 key.

    See Also
    InputDevice

    numpad3Key

    The 3 key on the numpad. The key with the numpad2Key to its left and the numpadEnterKey to its right.

    Declaration
    public KeyControl numpad3Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the numpad 3 key.

    See Also
    InputDevice

    numpad4Key

    The 4 key on the numpad. The key on the left side of the numpad with the numpad1Key below it and the numpad7Key above it.

    Declaration
    public KeyControl numpad4Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the numpad 4 key.

    See Also
    InputDevice

    numpad5Key

    The 5 key on the numpad. The key in-between the numpad4Key to the left and the numpad6Key to the right.

    Declaration
    public KeyControl numpad5Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the numpad 5 key.

    See Also
    InputDevice

    numpad6Key

    The 6 key on the numpad. The key in-between the numpad5Key to the let and the numpadPlusKey to the right.

    Declaration
    public KeyControl numpad6Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the numpad 6 key.

    See Also
    InputDevice

    numpad7Key

    The 7 key on the numpad. The key on the left side of the numpad with numpad4Key below it and numLockKey above it.

    Declaration
    public KeyControl numpad7Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the numpad 7 key.

    See Also
    InputDevice

    numpad8Key

    The 8 key on the numpad. The key in-between the numpad7Key to the left and the numpad9Key to the right.

    Declaration
    public KeyControl numpad8Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the numpad 8 key.

    See Also
    InputDevice

    numpad9Key

    The 9 key on the numpad. The key in-between the numpad8Key to the left and the numpadMinusKey to the right (or, on 17-key PC keyboard numpads, the elongated plus key).

    Declaration
    public KeyControl numpad9Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the numpad 9 key.

    See Also
    InputDevice

    numpadDivideKey

    The divide ('/') key on the numpad. The key in-between numpadEqualsKey to the left and numpadMultiplyKey to the right.

    Declaration
    public KeyControl numpadDivideKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the numpad divide key.

    PC keyboards usually have a 17-key numpad layout that differs from the 18-key layout we use for reference. The 18-key layout is usually found on Mac keyboards. The numpad divide key usually is the numpadEqualsKey on PC keyboards.

    See Also
    InputDevice

    numpadEnterKey

    The enter key on the numpad. The key sitting in the bottom right corner of the numpad.

    Declaration
    public KeyControl numpadEnterKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the numpad enter key.

    See Also
    InputDevice

    numpadEqualsKey

    The equals ('=') key on the numpad. The key in-between numLockKey to the left and numpadDivideKey to the right in the top row of the numpad.

    Declaration
    public KeyControl numpadEqualsKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the numpad equals key.

    PC keyboards usually have a 17-key numpad layout that differs from the 18-key layout we use for reference. The 18-key layout is usually found on Mac keyboards.

    17-key numpad layouts do not usually have an equals key. On these PC keyboards, the equals key is usually the divide key.

    See Also
    InputDevice

    numpadMinusKey

    The minus ('-') key on the numpad. The key on the right side of the numpad with numpadMultiplyKey above it and numpadPlusKey below it.

    Declaration
    public KeyControl numpadMinusKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the numpad minus key.

    PC keyboards usually have a 17-key numpad layout that differs from the 18-key layout we use for reference. The 18-key layout is usually found on Mac keyboards. The numpad minus key is usually not present on PC keyboards. Instead, the 17-key layout has an elongated numpadPlusKey that covers the space of two keys.

    See Also
    InputDevice

    numpadMultiplyKey

    The multiply ('*') key on the numpad. The key in the upper right corner of the numpad with numpadDivideKey to the left and numpadMultiplyKey below it.

    Declaration
    public KeyControl numpadMultiplyKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the numpad multiply key.

    PC keyboards usually have a 17-key numpad layout that differs from the 18-key layout we use for reference. The 18-key layout is usually found on Mac keyboards. The numpad multiply key usually is the numpadMinusKey on PC keyboards.

    See Also
    InputDevice

    numpadPeriodKey

    The period ('.') key on the numpad. The key in-between the numpadEnterKey to the right and the numpad0Key to the left.

    Declaration
    public KeyControl numpadPeriodKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the numpad period key.

    This key is the same in 17-key and 18-key numpad layouts.

    See Also
    InputDevice

    numpadPlusKey

    The plus ('+') key on the numpad. The key on the right side of the numpad with numpadMinusKey above it and numpadEnterKey below it.

    Declaration
    public KeyControl numpadPlusKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the numpad plus key.

    PC keyboards usually have a 17-key numpad layout that differs from the 18-key layout we use for reference. The 18-key layout is usually found on Mac keyboards.

    In particular, the plus key on the numpad is usually an elongated key that covers the space of two keys. These 17-key numpads do not usually have a numpadEqualsKey and the key above the plus key will usually be the numpad minus key.

    However, both on a 17-key and 18-key numpad, the plus key references the same physical key.

    See Also
    InputDevice

    oKey

    The 'o' key. The key in-between the iKey to the left and the pKey to the right in the top row of alphabetic characters.

    Declaration
    public KeyControl oKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the o key.

    See Also
    InputDevice

    oem1Key

    First additional key on the keyboard.

    Declaration
    public KeyControl oem1Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing OEM1.

    Keyboards may have additional keys that are not part of the standardized 104-key keyboard layout (105 in the case of an 18-key numpad). For example, many non-English keyboard layouts have an additional key in-between leftShiftKey and zKey.

    Additional keys may be surfaced by the platform as "OEM" keys. There is no guarantee about where the keys are located and what symbols they produce. The OEM key controls are mainly there to surface the inputs but not with the intention of being used in standard bindings.

    See Also
    InputDevice

    oem2Key

    Second additional key on the keyboard.

    Declaration
    public KeyControl oem2Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing OEM2.

    Keyboards may have additional keys that are not part of the standardized 104-key keyboard layout (105 in the case of an 18-key numpad). For example, many non-English keyboard layouts have an additional key in-between leftShiftKey and zKey.

    Additional keys may be surfaced by the platform as "OEM" keys. There is no guarantee about where the keys are located and what symbols they produce. The OEM key controls are mainly there to surface the inputs but not with the intention of being used in standard bindings.

    See Also
    InputDevice

    oem3Key

    Third additional key on the keyboard.

    Declaration
    public KeyControl oem3Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing OEM3.

    Keyboards may have additional keys that are not part of the standardized 104-key keyboard layout (105 in the case of an 18-key numpad). For example, many non-English keyboard layouts have an additional key in-between leftShiftKey and zKey.

    Additional keys may be surfaced by the platform as "OEM" keys. There is no guarantee about where the keys are located and what symbols they produce. The OEM key controls are mainly there to surface the inputs but not with the intention of being used in standard bindings.

    See Also
    InputDevice

    oem4Key

    Fourth additional key on the keyboard.

    Declaration
    public KeyControl oem4Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing OEM4.

    Keyboards may have additional keys that are not part of the standardized 104-key keyboard layout (105 in the case of an 18-key numpad). For example, many non-English keyboard layouts have an additional key in-between leftShiftKey and zKey.

    Additional keys may be surfaced by the platform as "OEM" keys. There is no guarantee about where the keys are located and what symbols they produce. The OEM key controls are mainly there to surface the inputs but not with the intention of being used in standard bindings.

    See Also
    InputDevice

    oem5Key

    Fifth additional key on the keyboard.

    Declaration
    public KeyControl oem5Key { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing OEM5.

    Keyboards may have additional keys that are not part of the standardized 104-key keyboard layout (105 in the case of an 18-key numpad). For example, many non-English keyboard layouts have an additional key in-between leftShiftKey and zKey.

    Additional keys may be surfaced by the platform as "OEM" keys. There is no guarantee about where the keys are located and what symbols they produce. The OEM key controls are mainly there to surface the inputs but not with the intention of being used in standard bindings.

    See Also
    InputDevice

    pKey

    The 'p' key. The key in-between the oKey to the left and the leftBracketKey to the right in the top row of alphabetic characters.

    Declaration
    public KeyControl pKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the p key.

    See Also
    InputDevice

    pageDownKey

    The page down key. Usually in a separate block with endKey to the left and pageUpKey above it.

    Declaration
    public KeyControl pageDownKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the page down key.

    See Also
    InputDevice

    pageUpKey

    The page up key. Usually in a separate block with homeKey to the left and pageDownKey below it.

    Declaration
    public KeyControl pageUpKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the page up key.

    See Also
    InputDevice

    pauseKey

    The pause/break key. The key sitting to the left of scrollLockKey. May also be labeled "F15".

    Declaration
    public KeyControl pauseKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the pause/break key.

    See Also
    InputDevice

    periodKey

    The '.' key. Second key to the left of rightShiftKey.

    Declaration
    public KeyControl periodKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the period key.

    See Also
    InputDevice

    printScreenKey

    The Print Screen key. The key sitting in-between f12Key to the left and scrollLockKey to the right. May also be labeled "F13".

    Declaration
    public KeyControl printScreenKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the print screen key.

    See Also
    InputDevice

    qKey

    The 'q' key. The key in-between the tabKey to the left and the wKey to the right in the top row of alphabetic characters.

    Declaration
    public KeyControl qKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the q key.

    See Also
    InputDevice

    quoteKey

    The ' key. The key immediately to the left of enterKey.

    Declaration
    public KeyControl quoteKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the quote key.

    See Also
    InputDevice

    rKey

    The 'r' key. The key in-between the eKey to the left and the tKey to the right in the top row of alphabetic characters.

    Declaration
    public KeyControl rKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the r key.

    See Also
    InputDevice

    rightAltKey

    The alt/option key on the right side of the keyboard.

    Declaration
    public KeyControl rightAltKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the right alt/option key.

    See Also
    InputDevice

    rightAppleKey

    Same as rightMetaKey. Apple/command system key on right side of keyboard.

    Declaration
    public KeyControl rightAppleKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the right Apple/command system key.

    See Also
    InputDevice

    rightArrowKey

    The right arrow key. Usually in a block by itself and generally to the right of downArrowKey

    Declaration
    public KeyControl rightArrowKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the right arrow key.

    See Also
    InputDevice

    rightBracketKey

    The ']' key. The key in-between leftBracketKey to the left and backslashKey to the right.

    Declaration
    public KeyControl rightBracketKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the right bracket key.

    See Also
    InputDevice

    rightCommandKey

    Same as rightMetaKey. Apple/command system key on right side of keyboard.

    Declaration
    public KeyControl rightCommandKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the right Apple/command system key.

    See Also
    InputDevice

    rightCtrlKey

    The control/ctrl key on the right side of the keyboard.

    Declaration
    public KeyControl rightCtrlKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    This key is usually not present on Mac laptops. KeyControl representing the right control key.

    See Also
    InputDevice

    rightMetaKey

    The system "meta" key (Windows key on PC, Apple/command key on Mac) on the right side of the keyboard.

    Declaration
    public KeyControl rightMetaKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the right system meta key.

    See Also
    InputDevice

    rightShiftKey

    The shift key on the right side of the keyboard.

    Declaration
    public KeyControl rightShiftKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the right shift key.

    See Also
    InputDevice

    rightWindowsKey

    Same as rightMetaKey. Windows system key on right side of keyboard.

    Declaration
    public KeyControl rightWindowsKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the right Windows system key.

    See Also
    InputDevice

    sKey

    The 's' key. The key in-between the aKey to the left and the dKey to the right in the middle row of alphabetic characters.

    Declaration
    public KeyControl sKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the s key.

    See Also
    InputDevice

    scrollLockKey

    The Scroll Lock key. The key in-between the printScreenKey to the left and the pauseKey to the right. May also be labeled "F14".

    Declaration
    public KeyControl scrollLockKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the scroll lock key.

    See Also
    InputDevice

    semicolonKey

    The ';' key. The key immediately to the left of quoteKey.

    Declaration
    public KeyControl semicolonKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the semicolon key.

    See Also
    InputDevice

    shiftKey

    An artificial combination of leftShiftKey and rightShiftKey into one control.

    Declaration
    public ButtonControl shiftKey { get; protected set; }
    Property Value
    Type Description
    ButtonControl
    Remarks

    ButtonControl representing a combined left and right shift key.

    This is a synthetic button which is considered pressed whenever the left and/or right shift key is pressed.

    See Also
    InputDevice

    slashKey

    The '/' key. The key immediately to the left of rightShiftKey.

    Declaration
    public KeyControl slashKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the forward slash key.

    See Also
    InputDevice

    spaceKey

    The space bar key at the bottom of the keyboard.

    Declaration
    public KeyControl spaceKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the space bar key.

    See Also
    InputDevice

    tKey

    The 't' key. The key in-between the rKey to the left and the yKey to the right in the top row of alphabetic characters.

    Declaration
    public KeyControl tKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the t key.

    See Also
    InputDevice

    tabKey

    The tab key, which is generally located on the left side above the capsLockKey.

    Declaration
    public KeyControl tabKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the tab key.

    See Also
    InputDevice

    uKey

    The 'u' key. The key in-between the yKey to the left and the iKey to the right in the top row of alphabetic characters.

    Declaration
    public KeyControl uKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the u key.

    See Also
    InputDevice

    upArrowKey

    The up arrow key. Usually in a block by itself and generally on top of the downArrowKey.

    Declaration
    public KeyControl upArrowKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the up arrow key.

    See Also
    InputDevice

    vKey

    The 'v' key. The key in-between the cKey to the left and the bKey to the right in the bottom row of alphabetic characters.

    Declaration
    public KeyControl vKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the v key.

    See Also
    InputDevice

    wKey

    The 'w' key. The key in-between the qKey to the left and the eKey to the right in the top row of alphabetic characters.

    Declaration
    public KeyControl wKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the w key.

    See Also
    InputDevice

    xKey

    The 'x' key. The key in-between the zKey to the left and the cKey to the right in the bottom row of alphabetic characters.

    Declaration
    public KeyControl xKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the x key.

    See Also
    InputDevice

    yKey

    The 'y' key. The key in-between the tKey to the left and the uKey to the right in the top row of alphabetic characters.

    Declaration
    public KeyControl yKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the y key.

    See Also
    InputDevice

    zKey

    The 'z' key. The key in-between the leftShiftKey to the left and the xKey to the right in the bottom row of alphabetic characters.

    Declaration
    public KeyControl zKey { get; }
    Property Value
    Type Description
    KeyControl
    Remarks

    KeyControl representing the z key.

    See Also
    InputDevice

    Methods

    FindKeyOnCurrentKeyboardLayout(string)

    Return the key control that, according to the currently active keyboard layout (see keyboardLayout), is associated with the given text.

    Declaration
    public KeyControl FindKeyOnCurrentKeyboardLayout(string displayName)
    Parameters
    Type Name Description
    string displayName

    Display name reported for the key according to the currently active keyboard layout.

    Returns
    Type Description
    KeyControl

    The key control corresponding to the given text or null if no such key was found on the current keyboard layout.

    Remarks

    In most cases, this means that the key inputs the given text when pressed. However, this does not have to be the case. Keys do not necessarily lead to character input.

    Examples
    using UnityEngine;
    using UnityEngine.InputSystem;
    
    public class KeyboardUtils : MonoBehaviour
    {
        private void FindKey()
        {
            // Retrieve the q key on the current keyboard layout.
            Keyboard.current.FindKeyOnCurrentKeyboardLayout("q");
        }
    }
    See Also
    keyboardLayout

    FinishSetup()

    Called after the keyboard has been constructed but before it is added to the system.

    Declaration
    protected override void FinishSetup()
    Overrides
    InputControl.FinishSetup()
    Remarks

    This method can be overridden to perform control- or device-specific setup work. The most common use case is for looking up child controls and storing them in local getters.

    Examples
    using UnityEngine.InputSystem;
    using UnityEngine.InputSystem.Controls;
    
    public class MyKeyboard : Keyboard
    {
        public ButtonControl button { get; private set; }
    
        protected override void FinishSetup()
        {
            // Cache controls in getters.
            button = (ButtonControl)GetChildControl("button");
        }
    }
    See Also
    InputDevice

    MakeCurrent()

    Make this the current device of its type.

    Declaration
    public override void MakeCurrent()
    Overrides
    InputDevice.MakeCurrent()
    Remarks

    This method is called automatically by the input system when a device is added or when input is received on it. Many types of devices have .current getters that allow querying the last used device of a specific type directly (for example, see current).

    There is one special case, however, related to noise. A device that has noisy controls (i.e. controls for which noisy is true) may receive input events that contain no meaningful user interaction but are simply just noise from the device. A good example of this is the PS4 gamepad which has a built-in gyro and may thus constantly feed events into the input system even if not being actually in use. If, for example, an Xbox gamepad and PS4 gamepad are both connected to a PC and the user is playing with the Xbox gamepad, the PS4 gamepad would still constantly make itself current by simply flooding the system with events. Hence why by default, noise on .current getters will be filtered out and a device will only see MakeCurrent getting called if their input was detected on non-noisy controls.

    Examples
    using UnityEngine;
    using UnityEngine.InputSystem;
    
    public class InputExample : MonoBehaviour
    {
        void Start()
        {
            // Add a keyboard and make it the current keyboard.
            var keyboard = InputSystem.AddDevice("Keyboard");
            keyboard.MakeCurrent();
        }
    }
    See Also
    current
    current
    current
    current

    OnIMECompositionChanged(IMECompositionString)

    This is called to set the IME composition strings. Fired once for every change containing the entire string.

    Declaration
    public void OnIMECompositionChanged(IMECompositionString compositionString)
    Parameters
    Type Name Description
    IMECompositionString compositionString

    The IMECompositionString for the IME composition.

    Remarks

    To call back to the changed composition string, subscribe to the onIMECompositionChange event.

    Examples
    using UnityEngine;
    using UnityEngine.InputSystem;
    using UnityEngine.InputSystem.LowLevel;
    
    public class KeyboardUtils : MonoBehaviour
    {
        private string compositionString = "";
        void ChangeIMEComposition()
        {
            // Manually creating an input event to change the IME composition
            var inputEvent = IMECompositionEvent.Create(Keyboard.current.deviceId, "CompositionTestCharacters! ɝ", Time.time);
            Keyboard.current.OnIMECompositionChanged(inputEvent.compositionString);
        }
    }
    See Also
    IMECompositionString
    onIMECompositionChange

    OnRemoved()

    Called by the system when the device is removed from devices.

    Declaration
    protected override void OnRemoved()
    Overrides
    InputDevice.OnRemoved()
    Remarks

    This is called after the device has already been removed. devicesRemovedOnAdded()

    Examples
      using UnityEngine.InputSystem;
    
                                                                                                                                                                                                                                  public class MyDevice : InputDevice
                                                                                                                                                                                                                                  {
                                                                                                                                                                                                                                      public static MyDevice current { get; private set; }
                                                                                                                                                                                                                                      protected override void OnRemoved()
                                                                                                                                                                                                                                      {
                                                                                                                                                                                                                                          // use this context to unassign the current device for instance
                                                                                                                                                                                                                                          base.OnRemoved();
                                                                                                                                                                                                                                          if (current == this)
                                                                                                                                                                                                                                              current = null;
                                                                                                                                                                                                                                      }
                                                                                                                                                                                                                                  }
    
    See Also
    InputDevice

    OnTextInput(char)

    Called when text input on the keyboard is received.

    Declaration
    public void OnTextInput(char character)
    Parameters
    Type Name Description
    char character

    A char type value that represents the character that has been entered.

    Remarks

    The system will call this method automatically whenever a TextEvent is received that targets the keyboard device. Subscribe to this event by using onTextInput.

    Examples
    using UnityEngine;
    using UnityEngine.InputSystem;
    
    public class OnTextInputExample : MonoBehaviour
    {
        // Simulate text input event on the current keyboard.
        private void FakeInput()
        {
            Keyboard.current.OnTextInput('a');
        }
    }
    See Also
    InputDevice

    RefreshConfiguration()

    Refresh the configuration of the control. This is used to update the control's state (e.g. Keyboard Layout or display Name of Keys).

    Declaration
    protected override void RefreshConfiguration()
    Overrides
    InputControl.RefreshConfiguration()
    Remarks

    The system will call this method automatically whenever a change is made to one of the control's configuration properties. This method is only relevant if you are implementing your own devices or new types of controls which are fetching configuration data from the devices (such as KeyControl which is fetching display names for individual keys from the underlying platform). See RefreshConfigurationIfNeeded().

    Examples
      using UnityEngine.InputSystem;
                            using UnityEngine.InputSystem.Utilities;
    
                            public class MyDevice : InputDevice
                            {
                                public enum Orientation
                                {
                                    Horizontal,
                                    Vertical,
                                }
                                private Orientation m_Orientation;
                                private static InternedString s_Vertical = new InternedString("Vertical");
                                private static InternedString s_Horizontal = new InternedString("Horizontal");
    
                                public Orientation orientation
                                {
                                    get
                                    {
                                        // Call RefreshOrientation if the configuration of the device has been
                                        // invalidated since last time we initialized m_Orientation.
                                        // Calling RefreshConfigurationIfNeeded() is sufficient in most cases, RefreshConfiguration() forces the refresh.
                                        RefreshConfiguration();
                                        return m_Orientation;
                                    }
                                }
                                protected override void RefreshConfiguration()
                                {
                                    // Set Orientation back to horizontal. Alternatively fetch from device.
                                    m_Orientation = Orientation.Horizontal;
                                    // Reflect the orientation on the device.
                                    switch (m_Orientation)
                                    {
                                        case Orientation.Vertical:
                                            InputSystem.RemoveDeviceUsage(this, s_Horizontal);
                                            InputSystem.AddDeviceUsage(this, s_Vertical);
                                            break;
    
                                        case Orientation.Horizontal:
                                            InputSystem.RemoveDeviceUsage(this, s_Vertical);
                                            InputSystem.AddDeviceUsage(this, s_Horizontal);
                                            break;
                                    }
                                }
                            }
    
    See Also
    InputDevice

    SetIMECursorPosition(Vector2)

    Sets the cursor position for IME composition dialogs. Units are from the upper left, in pixels, moving down and to the right.

    Declaration
    public void SetIMECursorPosition(Vector2 position)
    Parameters
    Type Name Description
    Vector2 position

    A Vector2 of the IME cursor position to set.

    Remarks

    Some languages use complex input methods which involve opening windows to insert characters. Typically, this is not desirable while playing a game, as games may just interpret key strokes as game input, not as text.

    See SetIMEEnabled(bool) for turning IME on/off

    Examples
    using UnityEngine;
    using UnityEngine.InputSystem;
    
    public class KeyboardUtils : MonoBehaviour
    {
        private Vector2 cursorPosition;
    
        void Update ()
        {
            // Set the IME cursor position to the mouse position
            var x = Mouse.current.position.x.ReadValue();
            var y = Mouse.current.position.y.ReadValue();
            cursorPosition = new Vector2(x, y);
            Keyboard.current.SetIMECursorPosition(cursorPosition);
        }
    }
    See Also
    InputDevice

    SetIMEEnabled(bool)

    Activates/deactivates IME composition while typing. This decides whether to use the OS supplied IME system or not.

    Declaration
    public void SetIMEEnabled(bool enabled)
    Parameters
    Type Name Description
    bool enabled

    The IME composition enabled state. true to enable the IME, false to disable it.

    Remarks

    Some languages use complex input methods which involve opening windows to insert characters. Typically, this is not desirable while playing a game, as games may just interpret key strokes as game input, not as text. Setting this to On, will enable the OS-level IME system when the user presses keystrokes.

    See SetIMECursorPosition(Vector2), onIMECompositionChange, imeSelected for more IME settings and data.

    Examples
    using UnityEngine;
    using UnityEngine.InputSystem;
    
    public class KeyboardUtils : MonoBehaviour
    {
        private string compositionString = "";
    
        void Start(){
            Keyboard.current.SetIMEEnabled(true);
            Keyboard.current.onIMECompositionChange += composition =>
            {
                compositionString = composition.ToString();
            };
        }
    }
    See Also
    InputDevice

    Events

    onIMECompositionChange

    When a user is entering text using IME composition, this event occurs each time the IME composition string changes, and provides the new composition string as a value. When using an IME, this event can be used to display the composition string while it is being edited.

    Declaration
    public event Action<IMECompositionString> onIMECompositionChange
    Event Type
    Type Description
    Action<IMECompositionString>
    Remarks

    The composition string is held by the IMECompositionString struct. When a composition string is submitted, one or many OnTextInput(char) events will fire with the submitted characters.

    Some languages use complex input methods which involve opening windows to insert characters. Typically, this is not desirable while playing a game, as games may just interpret key strokes as game input, not as text.

    Many IMEs cause this event to fire with a blank string when the composition is submitted or reset, however it is best not to rely on this behaviour since it is IME dependent.

    See SetIMEEnabled(bool) for turning IME on/off

    Examples

    To subscribe to the onIMECompositionChange event, use the following sample code:

    using UnityEngine;
    using UnityEngine.InputSystem;
    public class KeyboardUtils : MonoBehaviour
    {
    private string compositionString = "";
    void Start(){
        Keyboard.current.onIMECompositionChange += composition =>
        {
            compositionString = composition.ToString();
        };
    }
    
    }
    See Also
    InputDevice

    onTextInput

    Event that is fired for every single character entered on the keyboard. See OnTextInput(char).

    Declaration
    public event Action<char> onTextInput
    Event Type
    Type Description
    Action<char>
    Examples
    using System;
    using UnityEngine;
    using UnityEngine.InputSystem;
    
    // Let's say we want to do a typing game. We could define a component
    // something along those lines to match the typed input.
    public class MatchTextByTyping : MonoBehaviour
    {
        public string text
        {
            get => m_Text;
            set
            {
                m_Text = value;
                m_Position = 0;
            }
        }
    
        public Action onTextTypedCorrectly { get; set; }
        public Action onTextTypedIncorrectly { get; set; }
    
        private int m_Position;
        private string m_Text;
    
        protected void OnEnable()
        {
            Keyboard.current.onTextInput += OnTextInput;
        }
    
        protected void OnDisable()
        {
            Keyboard.current.onTextInput -= OnTextInput;
        }
    
        private void OnTextInput(char ch)
        {
            if (m_Text == null || m_Position >= m_Text.Length)
                return;
    
            if (m_Text[m_Position] == ch)
            {
                ++m_Position;
                if (m_Position == m_Text.Length)
                    onTextTypedCorrectly?.Invoke();
            }
            else
            {
                m_Text = null;
                m_Position = 0;
    
                onTextTypedIncorrectly?.Invoke();
            }
        }
    }
    See Also
    InputDevice

    Implements

    ITextInputReceiver

    Extension Methods

    InputControlExtensions.CheckStateIsAtDefault(InputControl)
    InputControlExtensions.CheckStateIsAtDefault(InputControl, void*, void*)
    InputControlExtensions.CheckStateIsAtDefaultIgnoringNoise(InputControl)
    InputControlExtensions.CheckStateIsAtDefaultIgnoringNoise(InputControl, void*)
    InputControlExtensions.CompareState(InputControl, void*, void*)
    InputControlExtensions.CompareState(InputControl, void*, void*, void*)
    InputControlExtensions.CompareStateIgnoringNoise(InputControl, void*)
    InputControlExtensions.FindControlsRecursive<TControl>(InputControl, IList<TControl>, Func<TControl, bool>)
    InputControlExtensions.FindInParentChain<TControl>(InputControl)
    InputControlExtensions.GetStatePtrFromStateEvent(InputControl, InputEventPtr)
    InputControlExtensions.HasValueChangeInEvent(InputControl, InputEventPtr)
    InputControlExtensions.HasValueChangeInState(InputControl, void*)
    InputControlExtensions.IsActuated(InputControl, float)
    InputControlExtensions.IsPressed(InputControl, float)
    InputControlExtensions.ReadDefaultValueAsObject(InputControl)
    InputControlExtensions.ReadValueAsObject(InputControl)
    InputControlExtensions.ReadValueFromEventAsObject(InputControl, InputEventPtr)
    InputControlExtensions.ReadValueIntoBuffer(InputControl, void*, int)
    InputControlExtensions.ResetToDefaultStateInEvent(InputControl, InputEventPtr)
    InputControlExtensions.WriteValueFromObjectIntoEvent(InputControl, InputEventPtr, object)
    InputControlExtensions.WriteValueIntoEvent<TValue>(InputControl, TValue, InputEventPtr)
    InputControlExtensions.WriteValueIntoState(InputControl, void*)
    InputControlExtensions.WriteValueIntoState<TValue>(InputControl, TValue, void*)
    InputControlExtensions.CopyState(InputDevice, void*, int)
    InputControlExtensions.CopyState<TState>(InputDevice, out TState)

    See Also

    InputDevice

    Did you find this page useful? Please give it a rating:

    Thanks for rating this page!

    Report a problem on this page

    What kind of problem would you like to report?

    • This page needs code samples
    • Code samples do not work
    • Information is missing
    • Information is incorrect
    • Information is unclear or confusing
    • There is a spelling/grammar error on this page
    • Something else

    Thanks for letting us know! This page has been marked for review based on your feedback.

    If you have time, you can provide more information to help us fix the problem faster.

    Provide more information

    You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:

    You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:

    You've told us there is information missing from this page. Please tell us more about what's missing:

    You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:

    You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:

    You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:

    You've told us this page has a problem. Please tell us more about what's wrong:

    Thank you for helping to make the Unity documentation better!

    Your feedback has been submitted as a ticket for our documentation team to review.

    We are not able to reply to every ticket submitted.

    In This Article
    • Fields
      • KeyCount
    • Properties
      • this[Key]
      • aKey
      • allKeys
      • altKey
      • anyKey
      • bKey
      • backquoteKey
      • backslashKey
      • backspaceKey
      • cKey
      • capsLockKey
      • commaKey
      • contextMenuKey
      • ctrlKey
      • current
      • dKey
      • deleteKey
      • digit0Key
      • digit1Key
      • digit2Key
      • digit3Key
      • digit4Key
      • digit5Key
      • digit6Key
      • digit7Key
      • digit8Key
      • digit9Key
      • downArrowKey
      • eKey
      • endKey
      • enterKey
      • equalsKey
      • escapeKey
      • f10Key
      • f11Key
      • f12Key
      • f13Key
      • f14Key
      • f15Key
      • f16Key
      • f17Key
      • f18Key
      • f19Key
      • f1Key
      • f20Key
      • f21Key
      • f22Key
      • f23Key
      • f24Key
      • f2Key
      • f3Key
      • f4Key
      • f5Key
      • f6Key
      • f7Key
      • f8Key
      • f9Key
      • fKey
      • gKey
      • hKey
      • homeKey
      • iKey
      • imeSelected
      • insertKey
      • jKey
      • kKey
      • keyboardLayout
      • keys
      • lKey
      • leftAltKey
      • leftAppleKey
      • leftArrowKey
      • leftBracketKey
      • leftCommandKey
      • leftCtrlKey
      • leftMetaKey
      • leftShiftKey
      • leftWindowsKey
      • mKey
      • minusKey
      • nKey
      • numLockKey
      • numpad0Key
      • numpad1Key
      • numpad2Key
      • numpad3Key
      • numpad4Key
      • numpad5Key
      • numpad6Key
      • numpad7Key
      • numpad8Key
      • numpad9Key
      • numpadDivideKey
      • numpadEnterKey
      • numpadEqualsKey
      • numpadMinusKey
      • numpadMultiplyKey
      • numpadPeriodKey
      • numpadPlusKey
      • oKey
      • oem1Key
      • oem2Key
      • oem3Key
      • oem4Key
      • oem5Key
      • pKey
      • pageDownKey
      • pageUpKey
      • pauseKey
      • periodKey
      • printScreenKey
      • qKey
      • quoteKey
      • rKey
      • rightAltKey
      • rightAppleKey
      • rightArrowKey
      • rightBracketKey
      • rightCommandKey
      • rightCtrlKey
      • rightMetaKey
      • rightShiftKey
      • rightWindowsKey
      • sKey
      • scrollLockKey
      • semicolonKey
      • shiftKey
      • slashKey
      • spaceKey
      • tKey
      • tabKey
      • uKey
      • upArrowKey
      • vKey
      • wKey
      • xKey
      • yKey
      • zKey
    • Methods
      • FindKeyOnCurrentKeyboardLayout(string)
      • FinishSetup()
      • MakeCurrent()
      • OnIMECompositionChanged(IMECompositionString)
      • OnRemoved()
      • OnTextInput(char)
      • RefreshConfiguration()
      • SetIMECursorPosition(Vector2)
      • SetIMEEnabled(bool)
    • Events
      • onIMECompositionChange
      • onTextInput
    • Implements
    • Extension Methods
    • See Also
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)