Enum.Keycode not accepting Values

Hello I am trying to make a toolbar for my game and have this issue with the UserInputService. I am trying to make it accept a value but not sure how since it is an enum.

UserInputService.InputBegan:Connect(function(input, gameProcessedEvent)
	local Range3 = NumberRange.new(49,57)
	if input.KeyCode >= Enum.KeyCode[Range3.Min] and input.KeyCode <= Enum.KeyCode[Range3.Max] then
	    print("TEST")
	end
end)

This is the current code I am using

And in the dev hub it has values but I have no Idea on how to use them.
KeyCode (roblox.com)

Thank you.

:thinking:

What are you wanting to accept a value…? A text box?

You can get the Value of an EnumItem which corresponds to its numerical value.

if input.KeyCode.Value >= Range3.Min and input.KeyCode.Value <= Range3.Max
1 Like