input

Keyboard and mouse functions

input.is_key_down

input.is_key_down(key_code): boolean

Argument

Type

Description

key_code

Number

LWJGL 2 Key code to check

Returns if the specified key is currently being pressed

Key codes can be found here: https://minecraft.fandom.com/el/wiki/Key_codes

input.is_mouse_down

input.is_mouse_down(mouse_button): boolean

Argument

Type

Description

mouse_button

Number

LWJGL 2 mouse button code to check

Returns if the specified mouse button is currently being pressed

input.get_key_name

input.get_key_name(key_code): string

Argument

Type

Description

key_code

Number

Key code

Returns the key name of a specified key code

input.get_key_number

input.get_key_name(key_name): number

Argument

Type

Description

key_name

String

Key name, such as "b"

Returns the key code of the specified key name

input.get_scroll

input.get_scroll(): number

Returns the scrolled amount in mouse wheel

Last updated

Was this helpful?