InputBegan doesn't work for I/O but InputEnded does

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.

Actual Behavior

You can see in this image that only the InputEnded message is printing.

Workaround
I have to go in game in order to test input with these keys since I can’t test them in studio.

Issue Area: Studio
Issue Type: Other
Impact: Moderate
Frequency: Constantly

1 Like

I found some posts mentioning the same issue but they weren’t posted on #bug-reports.

It seems to only be occurring for gameProcessedEvent keys.
Esc, I, O refuse to inoke InputBegan.

Left/Right Alt, Left/Right Control, Left/Right Shift and Tab also refuse to invoke the InputChanged event,

1 Like

This is only a problem in Roblox Studio. This works fine in the client. Studio bugs would have been more appropriate.

1 Like

Changed the content of the post to reflect this since I was unaware. Unfortunately I can’t seem to change the title or the category.

1 Like

Thanks for the report! We’ve filed a ticket to our internal database and we’ll follow up when we have an update for you.

3 Likes

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.

Welp, looks like this bug is still happening.

The code:

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)
1 Like