Input & clipboard
OS-level input helpers and clipboard access. Mouse coordinates are client-relative to the Roblox window.
Accepts a virtual-key code, a name ("space", "shift", "ctrl", "alt", "tab", "escape", "left", "right", "up", "down", "lmb", "rmb", "mmb", letters…), or an Enum.KeyCode item. Only reports true while the game is focused.
if iskeypressed("f") then
print("F is held")
end
Left / right mouse button state (focus-gated).
print(ismouse1pressed(), ismouse2pressed())
Synthesize a key tap using Windows virtual-key codes.
keypress(0x41)
keyrelease(0x41)
Move the cursor absolutely (client coords) or relatively; mousescroll sends wheel notches.
mousemoveabs(100, 100)
mousemoverel(10, 0)
mousescroll(1)
Left button control (click = press + release).
mouse1press()
mouse1release()
mouse1click()
Right button control.
mouse2press()
mouse2release()
mouse2click()
Copy text to the Windows clipboard, or read it back (Unicode text supported).
setclipboard("hello")
print(getclipboard())