So recently I have been working on UI and decided to work on a custom keybind script, after doing around 3 days of research I have found really no solution to my problem of understanding how to use Keybinds, and the methods I found are depricated.
So here is the article in Developer page about KeyCode but my script below unfortunately doesn’t detect input, and I am unsure what I am doing incorrectly. InputObject.KeyCode (roblox.com)
local function inputBegan(input)
if input.KeyCode == 8 then
print("Backspace Works")
end
end
UserInputService.InputBegan:Connect(inputBegan)
Yo have to use the Enum for the KeyCode as that’s what the input’s KeyCode contains, an Enum, giving it the name or the byte wont work
Perhaps try
local function inputBegan(input)
if input.KeyCode == Enum.KeyCode.Backspace then
print("Backspace Works")
end
end
UserInputService.InputBegan:Connect(inputBegan)
Autofill should show you the right Enum For backspace if I’m wrong