Does anyone know why User Input Service IsKeyDown doesn’t detect Left Control while it detect all others keycode like Left Shift etc?
local Game = game
local UserInputService = Game:GetService("UserInputService")
local function OnInputBegan(InputObject)
if InputObject.KeyCode.Name == "LeftControl" then print("Hello world!") end
end
UserInputService.InputBegan:Connect(OnInputBegan)
This is working for me.
1 Like
It is probably because of your keyboard. I had the same Issue too (tried making a c to crouch) but when i pressed c nothing happened. I then switched keyboards and then it worked. Not quite sure the reason behind this tho…
Yes but when I use left ctrl just using input.Keycode it works. But when I use isKeyDown it doesn’t work.
this is working fine for me.
local UserInPutService = game:GetService("UserInputService")
local function IsControlKeyDown()
return UserInPutService:IsKeyDown(Enum.KeyCode.LeftControl)
end
UserInPutService.InputBegan:Connect(function(input,gp)
if gp then return end
if input.KeyCode == Enum.KeyCode.LeftControl then
if IsControlKeyDown() then
print("Key Is Down")
else
print("No, key is not down.")
end
end
end)