How do I detect if there are two keys being pressed simultaneously using (User Input Service)

Anyone got any ideas on how I would do this thank you!

2 Likes

UIS:IsKeyDown() returns true if the key provided is pressed down. Works with multiple keys.

if uis:IsKeyDown(Enum.KeyCode.Q) and uis:IsKeyDown(Enum.KeyCode.E) then --if Q and E

    print("Q and E are pressed down!")

end
6 Likes

How would I use this please eloborate.

1 Like

its very simple. Use a and operator. and UserInputService:IsKeyDown(Enum KeyCode)

Link to DevHub UserInputService:IsKeyDown()

3 Likes

Thanks for elaborating this is sure to help me out thanks!

Greetings,
I believe this is the source you’ll be looking for, this automatically checks if you’re pressing a “Modifier Key” such as “CTRL + A” for example. The only problem using “UIS:IsKeyDown()” is that you need to have one pressed from the start.