Are there any variables for enum.keycode that can help make an on screen keyboard?

so i want to make an on screen keyboard and i have the enum.keycode variable but is there any sort of other variable that can make an on screen keyboard?

1 Like

Did you take a look here: UserInputService | Documentation - Roblox Creator Hub

Is it for mobile/console players? I’m pretty sure the built-in keyboard comes up when a TextBox is selected. If not, you can just call each button the name of the corresponding KeyCode, e.g. “F” or “Space” or “LeftShift”, then loop through all the buttons and set them up like this:


function onGuiKeyboardButtonPressed(keyCode)
	
end

function setupGuiKeyboardButton(button)
	button.MouseButton1Clicked:Connect(function()
		local keyCode = Enum.KeyCode[button.Name]
		onGuiKeyboardButtonPressed(keyCode)
	end)
end

I want it like a gui that can replicate a keyboard but still functions like in this game

It doesn’t actually seem to do anything in that game? Please try and explain what you’re trying to do

when a player executes a command then that keyboard allows mobile support for them. In your case you didnt say any commands. just say :wao2 and press e on the keybaord. Then you will see what i mean

Here’s what you can do for that: Just make a button that fires remoteevents connected to any keys you have bound to a real keyboards inputs.

ThanksRoBama’s post is pretty much the same thing that I do for my keyboard in that game. I have a do loop that binds TouchTap to to firing a remote matching each keys name.

If you’re looking for code, here’s almost what I do, just a bit less sloppy and simpler than my actual code:

MYREMOTEGOHERE is your remoteevent,
KeyboardFrame=the UI for your mobile keyboard, you set what this is


if game:GetService("UserInputService").TouchEnabled then
	touchscreen=true
end
for i,v in pairs(KeyboardFrame:GetChildren()) do
	spawn(function()
		if touchscreen then
			v.TouchTap:connect(function()
				MYREMOTEGOHERE:FireServer(string.lower(v.Name))
			end)
		else
			v.MouseButton1Click:connect(function()
				MYREMOTEGOHERE:FireServer(string.lower(v.Name))--Makes this work on PC too
			end)
		end
	end)	
end

If you want to use this locally, just use an event instead of a remoteevent

edit: a little grammar fix