Skip to content

input#

find_key_bound_to_binding#

returns key bound to a csgo setting

e_keys find_key_bound_to_binding(<string> setting_name)
Fields Description
setting_name
string
setting name

Example

local crouch_key = input.find_key_bound_to_binding("duck")
print("Is Crouching:", input.is_key_held(crouch_key))

get_mouse_pos#

returns x and y coordinates of the mouse position as a vec2_t

vec2_t get_mouse_pos()

Example

print(input.get_mouse_pos())

is_mouse_in_bounds#

returns if the mouse is in specified boundss

bool is_mouse_in_bounds(<vec2_t> bounds_start, <vec2_t> bounds_end)
Fields Description
bounds_start
vec2_t
area bounds start
bounds_end
vec2_t
area bounds end

Example

print(input.is_mouse_in_bounds(vec2_t(10,20),vec2_t(30,60)))

is_key_toggled#

returns if they key is toggled

bool is_key_toggled(<e_keys> key_code)
Fields Description
key_code
e_keys
key code

Example

local key_toggled = input.is_key_toggled(e_keys.KEY_C)
if(key_toggled) then
    print("key C toggled")
end

is_key_pressed#

returns if they key was just pressed

bool is_key_pressed(<e_keys> key_code)
Fields Description
key_code
e_keys
key code

Example

local key_pressed = input.is_key_pressed(e_keys.KEY_C)
if(key_pressed) then
    print("key C pressed")
end

is_key_released#

returns if current key was just released

bool is_key_released(<e_keys> key_code)
Fields Description
key_code
e_keys
key code enum

Example

local key_released = input.is_key_released(e_keys.KEY_C)
if(key_released) then
    print("key C released")
end

is_key_held#

returns if current key is held

bool is_key_held(<e_keys> key_code)
Fields Description
key_code
e_keys
key code enum

Example

local key_held = input.is_key_held(e_keys.KEY_C)
if(key_held) then
    print("key C held")
end

get_time_held#

returns how long a key was held for

float get_time_held(<e_keys> key_code)
Fields Description
key_code
e_keys
key code enum

Example

print(input.get_time_held(e_button_codes.KEY_C)) -- prints time held

get_scroll_delta#

returns mouse scroll delta

int get_scroll_delta()

Example

print(input.get_scroll_delta()) -- print scroll delta

get_key_name#

returns the key name for the key id

string get_key_name(<e_keys> key)

block#

blocks input for the next input tick

void block()