Input

Functions

IsKeyPressed (Boolean)

Check if a key is currently pressed.

This is to check if a key is currently being pressed/held down.

Parameters

  1. KeyCode (Integer)

Example

local TRUE = true
local FALSE = false
local isHoldingDownRightMouseButtonAkaRightClickForAimbotPurposes = FALSE;
if IsKeyPressed(Key.MOUSELEFT) then
    isHoldingDownRightMouseButtonAkaRightClickForAimbotPurposes = TRUE
else
    isHoldingDownRightMouseButtonAkaRightClickForAimbotPurposes = FALSE;
end

WasKeyPressed (Boolean)

Check if a key was pressed.

This is to check if a key WAS pressed. Use this if you're going to make keys toggle features, etc.

Parameters

  1. KeyCode (Integer)

Example

local waterWalk = false
if WasKeyPressed(Key.BACKSPACE) then
    -- backspace was pressed, lets toggle water walk
    
    waterWalk = not waterWalk
end

GetMousePosition (FVector)

Get the coordinates of the mouse.

X and Y will be -1 when the cursor is off the screen, on another monitor or not on the game window.

Example

local mouse_pos = GetMousePosition()
if mouse_pos.X == 0 then
    -- mouse one is at the very far left of the screen
end

Key

All key are pre-defined in the Key enum.

Last updated