The GetLastInputType function indicates the most recent 'Enum/UserInputType` used by the client. The function’s return is the UserInputType last used by the client.
For instance, if, at the time this function is called, the client’s last interaction with the game is pressing the spacebar, the UserInputType returned would be UserInputType.Keyboard, since the spacebar is the keyboard’s button.
If you want to track when the last input type used by the client changes, you can use the
UserInputService only runs client-side, this function will only work when used in a
An Enum indicating the last UserInputType used by the client.
This example gets and prints the name of the last UserInputType used by the client.