Hello there! I am creating a GUI that detects a user’s input for a controls list.
I am having an issue wherein my script does not detect Enum.KeyCode.LeftControl.
The odd thing here is that the same exact script works for other keycodes, except for the left control key. I have tried adding in a print function when the keyis pressed, but the script still doesn’t seem to detect the key.
Here is my LeftCtrl script:
local UIS = game:GetService("UserInputService")
local imageid = script.Parent.Image
UIS.InputBegan:Connect(function(input, processed)
if (input.KeyCode == Enum.KeyCode.LeftControl and processed == false) then
script.Parent.Image = "rbxgameasset://Images/long key pressed (1)"
end
end)
UIS.InputEnded:Connect(function(input, processed)
if (input.KeyCode == Enum.KeyCode.LeftControl and processed == false) then
script.Parent.Image = imageid
end
end)
Here is the exact same script with a different keycode:
local UIS = game:GetService("UserInputService")
local imageid = script.Parent.Image
UIS.InputBegan:Connect(function(input, processed)
if (input.KeyCode == Enum.KeyCode.LeftShift and processed == false) then
script.Parent.Image = "rbxgameasset://Images/long key pressed (1)"
end
end)
UIS.InputEnded:Connect(function(input, processed)
if (input.KeyCode == Enum.KeyCode.LeftShift and processed == false) then
script.Parent.Image = imageid
end
end)
And here is a video of the output:
If I could get some help here, that would be much appreciated!