Read me This only occurs in Studio, I cannot recategorize this post unfortunately. It also happens for all gameProcessedEvent keys, not just I/O like the title states.
Reproduction Steps
File (just has the code on this thread placed inside of StarterPlayerScripts): InputIssue.rbxl (28.8 KB)
Code:
local UserInputService = game:GetService("UserInputService");
UserInputService.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.Keyboard then
print("Input began for key:", input.KeyCode.Name);
end
end)
UserInputService.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.Keyboard then
print("Input ended for key:", input.KeyCode.Name);
end
end)
Expected Behavior
If I’m not checking whether gameProcessedEvent was true and manually returning then the code should print "Input began for key: " whenever I press any game processed keys.
If this is a bug, it’s still occurring in the current year.
edit: It seems UserInputService:IsKeyDown won’t even work for in/out keys. As of now the ONLY way of detecting the I and O keys being pressed are to use a TextBox with captured focus, which isn’t practical for many situations.
This is super annoying. There’s no reason to reserve these keys period.
Edit 2: I suppose you can try peeking into the CameraInput module in the player module.
This is very hacky and not future-proof, but it’s the only way I can think of doing this for now.
I was making an input handler for a terminal system, and I ran into this problem. I tried to solve it by unbinding RbxCameraKeypress using ContextActionService. However, that did not work.
Currently, the only workaround for me is to not playtest in Studio, which hinders my workflow.
local uis = game:GetService("UserInputService")
uis.InputBegan:Connect(function(obj)
if obj.UserInputType == Enum.UserInputType.Keyboard then
print(obj.KeyCode.Name.." key pressed!")
end
end)