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.
Definitely has sometihng to do with the IO camera key binds. But not sure why it only allows for InputStateEnd and not InputStateBegin.
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.