Input Sinking Cause?

local CONTEXT_ACTION_SERVICE = game:GetService("ContextActionService")

CONTEXT_ACTION_SERVICE:BindActionAtPriority(
	"TestInput",
	function(actionName, inputState, inputObject)
		if inputState == Enum.UserInputState.Begin then
			if (inputObject.KeyCode == Enum.KeyCode.O) then
				print("TEST")
			end
		end
		return Enum.ContextActionResult.Pass
	end,
	false,
	Enum.ContextActionPriority.High.Value,
	Enum.UserInputType.Keyboard
)

Any idea why this code won’t print when I press O? I think it has to do something with the default player scripts, but I did bind this at a high priority value but it still would not print.

I’ve done some testing within studio, seems like for some reason even with a high priority the keycode for the IO keys only prints when the user input state is ended.

image

Definitely has sometihng to do with the IO camera key binds. But not sure why it only allows for InputStateEnd and not InputStateBegin.

Reference IO core buttons:

1 Like
		local function keypress(action, state, input)
			keyboardState[input.KeyCode.Name] = state == Enum.UserInputState.Begin and 1 or 0
		end

corescripts are returning nil so they are sinking I, O, Left, and Right, but they’re a lower priority.

local CAMERA_INPUT_PRIORITY = Enum.ContextActionPriority.Default.Value
1 Like

So I’m assuming this is a bug? Maybe I should move this to #bug-reports ?

I did some tests and got equally funky results. I’d recommend filing a bug report since this isn’t expected or documented behaviour. These keys are also sunk for UserInputService and unbinding RbxCameraKeypress, the action for camera controls and the only mention of the I/O keycodes in the PlayerModule, does not change the results.

* FreecamKeyboard also uses this keycode. Similarly, unbinding the action still sinks these keys.

5 Likes