Input
Keyboard and mouse state, and input sent to Roblox.
Input
Keyboard and mouse state, and input sent to Roblox. Keys are Windows virtual-key codes (0x41 is A, 0x01 the left mouse button). Sent input reaches Roblox only while setgameinput is on, Roblox is the window in front and the evasive menu is closed. Keys and buttons a script holds are released when it stops.
setgameinput(enabled)Turns sent input on or off for every script (on by default). While it is off, keypress, mouse1click and the rest send nothing.
| Name | Type | Description |
|---|---|---|
enabled | boolean |
setgameinput(false)isrbxactive() -> booleantrue while the Roblox window is in front.
boolean
if isrbxactive() then mouse1click() endsetclipboard(value)Copies value to the Windows clipboard.
| Name | Type | Description |
|---|---|---|
value | string |
setclipboard("hello")keypress(keycode) -> booleanPresses a key and holds it until keyrelease.
| Name | Type | Description |
|---|---|---|
keycode | number | A Windows virtual-key code. |
boolean
keypress(0x57) -- Wkeyrelease(keycode) -> booleanReleases a key pressed with keypress.
| Name | Type | Description |
|---|---|---|
keycode | number |
boolean
keyrelease(0x57)iskeypressed(keycode) -> booleantrue while the key is held down.
| Name | Type | Description |
|---|---|---|
keycode | number |
boolean
if iskeypressed(0x10) then end -- Shiftismouse1pressed() -> booleantrue as long as you hold the left button.
boolean
ismouse2pressed() -> booleantrue as long as you hold the right button.
boolean
mouse1press()Presses the left mouse button and holds it.
mouse1release()Releases the left mouse button.
mouse1click()Clicks the left mouse button (press and release).
mouse1click()mouse2press()Presses the right mouse button and holds it.
mouse2release()Releases the right mouse button.
mouse2click()Clicks the right mouse button.
mousemoveabs(x, y)Moves the cursor to (x, y) in Roblox client pixels, top left 0, 0: the space WorldToScreen returns, so its result can go straight in.
| Name | Type | Description |
|---|---|---|
x | number | |
y | number |
local pos, visible = WorldToScreen(part.Position)
if visible then mousemoveabs(pos.X, pos.Y) endmousemoverel(x, y)Moves the cursor by (x, y) pixels from where it is.
| Name | Type | Description |
|---|---|---|
x | number | |
y | number |
mousemoverel(0, 10)mousescroll(amount)Scrolls in raw wheel units: 120 is one notch, a positive amount scrolls up and a negative one down.
| Name | Type | Description |
|---|---|---|
amount | number |
mousescroll(120)