PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

KeyboardEnabled

UserInputService

bool

This property describes whether the user’s device has a keyboard available. This property is true when the user’s device has an available keyboard, and false when it does not.

It can be used to determine whether the user has an available keyboard - which can be important if you want to check if you can use UserInputService/IsKeyDown or UserInputService/GetKeysPressed to check for keyboard input.

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


Code Samples


Check if Keyboard is Enabled

This example prints “The user’s device has an available keyboard!” if KeyboardEnabled is true and “The user’s device does not have an available keyboard!” if KeyboardEnabled is false.

local UserInputService = game:GetService("UserInputService")

if (UserInputService.KeyboardEnabled) then
	print("The user's device has an available keyboard!")
else
	print("The user's device does not have an available keyboard!")
end