UserInputService does not properly detect the presence of the SHIFT key upon the pressing of any Keypad button (CTRL and ALT are properly detected).
In addition, KeypadPeriod (KeyCode = 266) registers keypresses properly in Studio, but does not in an real game.
It is unknown how long this bug has existed.
The bug happens for Windows 10 but may also extend to other OS (untested).
Reproduction:
SHIFT not detected: Paste the following code into a LocalScript and place it in StarterPlayerScripts:
UserInputService = game:GetService("UserInputService")
UserInputService.InputBegan:Connect(function(Input,GPE)
if Input.UserInputType == Enum.UserInputType.Keyboard then
local KeyValue = Input.KeyCode.Value
if (KeyValue >= 256 and KeyValue <= 272) then
print("detected a keypad input")
print(Input:IsModifierKeyDown(0) or UserInputService:IsKeyDown(Enum.KeyCode.LeftShift) or UserInputService:IsKeyDown(Enum.KeyCode.RightShift))
if Input:IsModifierKeyDown(0) or UserInputService:IsKeyDown(Enum.KeyCode.LeftShift) or UserInputService:IsKeyDown(Enum.KeyCode.RightShift) then
print("shift was detected")
end
end
end
end)
Holding SHIFT and pressing any keypad key in Studio or in-game will show that SHIFT is not being detected.
KeypadPeriod not detected: Paste the following code into a LocalScript and place it in StarterPlayerScripts, then upload the place as a game:
UserInputService = game:GetService("UserInputService")
UserInputService.InputBegan:Connect(function(Input,GPE)
if Input.UserInputType == Enum.UserInputType.Keyboard then
local KeyValue = Input.KeyCode.Value
if (KeyValue == 266) then
print("pressed KeypadPeriod")
end
end
end)
Pressing KeypadPeriod in Studio testing will detect the keypress as expected; however, it will not be detected in a real game.
bugreport.rbxl (18.3 KB)