Hello devs, I have been trying this code :
print(UserInputService:GetStringForKeyCode(Enum.KeyCode.Left))
but its prints out blank string like this :
Can someone tell me why this happens?
Hello devs, I have been trying this code :
print(UserInputService:GetStringForKeyCode(Enum.KeyCode.Left))
but its prints out blank string like this :
Can someone tell me why this happens?
I’m not sure but what I would use to get the string/name of a keycode would be:
function getKeyCodeName(keyCode)
return keyCode.Name
end
“Name” is a property of an enum value.
I mean if I don’t want to use KeyCode like when you wan’t to use VirtualUser:SetKeyDown("left")
how do I do it?
This function exist because symbols can’t be just used as EnumItem names directly and there are cases where you would want to convert, for example, Enum.KeyCode.Equals
key to the string =
.
Oh ok, thanks for explanation!