Input
The Input library provides functions for simulating keyboard and mouse input in the Roblox window. These functions are only callable if Roblox's window is in the users focus.
Window Activity Check
iswindowactive()
isrbxactive()
isgameactive()
These functions are aliases and check if the Roblox window is currently active.
Returns: boolean
- true
if the Roblox window is active, false
otherwise.
Keyboard Functions
You can find a list of keycodes here: https://learn.microsoft.com/en-gb/windows/win32/inputdev/virtual-key-codes?redirectedfrom=MSDN
keypress(keyCode)
Simulates pressing a key.
keyCode
: The virtual key code of the key to press.
keytap(keyCode)
Simulates tapping (pressing and releasing) a key.
keyCode
: The virtual key code of the key to tap.
keyrelease(keyCode)
Simulates releasing a key.
keyCode
: The virtual key code of the key to release.
Mouse Functions
mouse1click()
Simulates a left mouse button click.
mouse1press()
Simulates pressing the left mouse button.
mouse1release()
Simulates releasing the left mouse button.
mouse2click()
Simulates a right mouse button click.
mouse2press()
Simulates pressing the right mouse button.
mouse2release()
Simulates releasing the right mouse button.
mousemoveabs(x, y)
Moves the mouse cursor to absolute screen coordinates.
x
: The x-coordinate.y
: The y-coordinate.
mousemoverel(dx, dy)
Moves the mouse cursor relative to its current position.
dx
: The change in x-coordinate.dy
: The change in y-coordinate.
mousescroll(delta)
Simulates scrolling the mouse wheel.
delta
: The amount to scroll. Positive values scroll up, negative values scroll down.
Example usage: