ContextActionService not picking up keypress


For some reason, when using ContextActionService and trying to detect when the Q key is pressed, if A and W are both pressed already, the Q press doesnt register at all.

ContextActionService:BindAction("Q_Pressed", fucntion(name, state, input)
    if state == Enum.UserInputState.Begin then print("Q was pressed!") end
    return Enum.ContextActionResult.Pass
end, false, Enum.KeyCode.Q)

ContextActionService:BindAction("Key_Pressed", fucntion(name, state, input)
    return Enum.ContextActionResult.Pass
end, false, Enum.UserInputType.Keyboard)

This code prints "Q was pressed!" when W and D are held down, likewise when A and S are held down, but when W and A are both held, nothing prints. Its as if Q wasnt pressed. Anyone know why the keypress is not being picked up?

I tried this in my game I was making, as well as in a blank baseplate to test. Both resulted in the Q press not being picked up. I haven’t tested this for other keys, just Q while the WASD keys are being pressed. I should also mention when 3 of the WASD keys are being pressed, regardless which ones, the Q press is not picked up either.

Any guidance would be appreciated.


1 Like

This is because there is a limit how many keys you can press and get processed which has to do with your Keyboard.

1 Like