PcoWSkbVqDnWTu_dm2ix
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.