UserInputService

Description

User Input Service

Properties

        bool   TouchActivated
    Describe whether the current user's device has an available touch screen. Read only.

        bool    OnScreenKeyboardVisible
    Describe whether the on-screen keyboard is visible on user's screen or not. Read only.

        Vector2   OnScreenKeyboardPosition
    Confirm on-screen keyboard position.

        bool   MouseCursorActivate
   Confirm whether the mouse icon is visible or not.

        bool   MouseActivate
   Describe whether the user's device has an available mouse or not. Read only.

        float   MouseSensitivity
   Mouse sensitivity. Configures how fast it moves on the screen.

        CursorLockMode   MouseMoveActivate
   Confirm whether the user's mouse is free to move or gets locked.

        bool   GyroscopeActivate
   Describe whether the user's device has a gyroscope. Read only.

Functions

    GetControllerGravity()
    Retrieves the gravity vector of the current device.

    GetControllerRotation()
    Retrieves the rotating angle of the current device.

    GetKeysPressed()
    Returns the InputObject array correlated with the current pressed enumerated key/code key.

    GetLastInputType()
    Returns the type of the last input.

    GetMouseButtonsPressed()
    Returns the inputObject array corresponding to the current pressed mouse button.

    GetMouseDelta()
    Returns the position offset of the player's mouse in the previous render frame (unit: pixel).

    GetMouseLocation()
    Returns the current position of the player's mouse in the screen.

    IsKeyDown()
    Returns whether the given key is being pressed.

    IsMouseButtonPressed()
    Returns whether the given mouse button is being pressed.

Events

    InputBegan()
    This event is triggered when the user input (mouse, touch, keyboard, etc.) starts.

    InputChanged()
    This event is triggered when the user input changes.

    InputEnded()
    This event is triggered when the user input ends.

    JumpRequired()
    This event is triggered when the user inputs to request a jump.

    LastInputTypeChanged()
    This event is triggered when the user input type changes.

    TouchEnded()
    This event is triggered when the user stops inputting on the touch device.

    TouchHoldpress()
    This event is triggered when the user has touched for a long time and been staying at the same position.

    TouchMoved()
    This event is triggered when the user is moving a finger on the touch device.

    TouchPan()
    This event is triggered when the user is panning one or more fingers on the touch device.

    TouchPinch()
    This event is triggered when two fingers are pinched or pulled apart.

    TouchRotate()
    This event is triggered when two fingers are rotated.

    TouchStarted()
    This event is triggered when the user starts to touch.

    TouchSwipe()
    This event is triggered when the user starts to swipe. Unlike TouchMove, TouchSwipe will pass in the moving direction.

    TouchTap()
    This event is triggered when the user touches lightly on the touch device.

    TouchTapInGame()
    This event is triggered when the user tap event occurs in the game world.