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.

Keys

BACKSPACE

TAB

ENTER

PAUSE

CAPSLOCK

ESCAPE

SPACE

PAGEUP

PAGEDOWN

END

HOME

LEFT

UP

RIGHT

DOWN

INSERT

DELETE

0

1

2

3

4

5

6

7

8

9

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

NUMPAD0

NUMPAD1

NUMPAD2

NUMPAD3

NUMPAD4

NUMPAD5

NUMPAD6

NUMPAD7

NUMPAD8

NUMPAD9

MULTIPLY

ADD

SUBTRACT

DECIMAL

DIVIDE

F1

F2

F3

F4

F5

F6

F7

F8

F9

F10

F11

F12

NUMLOCK

SCROLLLOCK

LEFTSHIFT

RIGHTSHIFT

LEFTCTRL

RIGHTCTRL

LEFTALT

RIGHTALT

SEMICOLON

EQUAL

COMMA

MINUS

PERIOD

SLASH

GRAVEACCENT

LEFTBRACKET

BACKSLASH

RIGHTBRACKET

MOUSELEFT

MOUSERIGHT

MOUSEMIDDLE

Last updated