CPU: Intel(R) Core™ i7-9700K CPU @ 3.60GHz
GPU: NVIDIA GeForce GTX 1050 Ti
Memory: 16.0GB
Expected Behavior UserInputService.KeyboardEnabled should be returning true if there’s a valid keyboard input found on the user’s device (excluding on-screen), else false.
Actual Behavior UserInputService.KeyboardEnabled appears to be returning true consistently, both in-game and in-studio, even when my keyboard is unplugged. I have closed and opened both of them. I’m listening for input changes (UserInputService:GetPropertyChangedSignal("KeyboardEnabled")), and this does not ever fire either.
My use-case
I have two buttons that display hotkeys on them. If there’s a controller found or they’re on Xbox (ten foot interface), then I disable them and show the Xbox button image. Else, if there’s a keyboard found, then it’ll show the keyboard hotkey. If neither are found, say the user is on mobile without a connected external keyboard, then it’ll leave it blank.
Issue Area: Engine Issue Type: Other Impact: High Frequency: Constantly Date First Experienced: 2022-01-14 00:01:00 (-06:00)
Sorry for bumping this, but can this issue be really officially looked into??
I am trying to detect whether a player has keyboard and mouse connected, without any prior inputs from them. The only working attribute is GamepadConnected. When a controller is connected, it returns true, vice versa. Why can’t KeyboardEnabled and MouseEnabled behave the same?
On PC, we always have mouse and keyboard enabled, because it is treated like as a platform identifier. This is not true on other devices like mobile or Xbox. So your use case should work correctly, independent of how it works on PC.
Thanks for the clarification. I wish KeyboardEnabled and MouseEnabled behaves the same as GamepadEnabled, which it returns false when the device is disconnected. I have recently release Mobile Device only servers for my game and it pauses the gameplay when Keyboard / Mouse is detected. When a player connects a keyboard to a phone / emulator, KeyboardEnabled and MouseEnabled will not return false once it becomes true, resulting the gameplay won’t be able to unpause.
Anyways, can this similar issue be looked into? KeyboardEnabled returns true on certain Android devices when pressing Backspace.