PcoWSkbVqDnWTu_dm2ix
The Developer Hub is now deprecated and information on this page may no longer be accurate. To see our new and improved documentation, please click here. You can read more about the future of documentation here.
Collapse Sidebar

GetLastInputType

This function returns 'Enum/UserInputType` associated with the user’s most recent input.

For example, if the user’s previous input had been pressing the spacebar, the Enum/UserInputType returned would be ‘Keyboard’.

The UserInputService/LastInputTypeChanged event can be used to track when the last Enum/UserInputType used by the user changes.

As UserInputService is client-side only, this function can only be used in a LocalScript.

Returns

Return Type Summary

The Enum/UserInputType associated with the user’s most recent input


Code Samples


UserInputService:GetLastInputType

This example gets the Enum/UserInputType|last input type and indicates if it was keyboard input.