yg.input
Functions for getting inputs.
function yg.input.get()
Gets the current value of the input source.
yg.input.get(source)
->number
Argument | Type | Info |
---|---|---|
source |
string | Name of the input source. Options: see Input Sources |
function yg.input.geti()
Gets the current value of the input sourcerounded to integer.
yg.input.geti(source)
->number
Argument | Type | Info |
---|---|---|
source |
string | Name of the input source. Options: see Input Sources |
function yg.input.getDelta()
Gets the value delta of the input source since last tick.
yg.input.getDelta(source)
->number
Argument | Type | Info |
---|---|---|
source |
string | Name of the input source. Options: see Input Sources |
Input Sources
These strings are accepted as source
argument by the functions above.
Name | Info |
---|---|
"KEY_UNKNOWN" |
- |
"KEY_SPACE" |
- |
"KEY_APOSTROPHE" |
- |
"KEY_COMMA" |
- |
"KEY_MINUS" |
- |
"KEY_PERIOD" |
- |
"KEY_SLASH" |
- |
"KEY_0" |
- |
"KEY_1" |
- |
"KEY_2" |
- |
"KEY_3" |
- |
"KEY_4" |
- |
"KEY_5" |
- |
"KEY_6" |
- |
"KEY_7" |
- |
"KEY_8" |
- |
"KEY_9" |
- |
"KEY_SEMICOLON" |
- |
"KEY_EQUAL" |
- |
"KEY_A" |
- |
"KEY_B" |
- |
"KEY_C" |
- |
"KEY_D" |
- |
"KEY_E" |
- |
"KEY_F" |
- |
"KEY_G" |
- |
"KEY_H" |
- |
"KEY_I" |
- |
"KEY_J" |
- |
"KEY_K" |
- |
"KEY_L" |
- |
"KEY_M" |
- |
"KEY_N" |
- |
"KEY_O" |
- |
"KEY_P" |
- |
"KEY_Q" |
- |
"KEY_R" |
- |
"KEY_S" |
- |
"KEY_T" |
- |
"KEY_U" |
- |
"KEY_V" |
- |
"KEY_W" |
- |
"KEY_X" |
- |
"KEY_Y" |
- |
"KEY_Z" |
- |
"KEY_LEFT_BRACKET" |
- |
"KEY_BACKSLASH" |
- |
"KEY_RIGHT_BRACKET" |
- |
"KEY_GRAVE_ACCENT" |
- |
"KEY_WORLD_1" |
- |
"KEY_WORLD_2" |
- |
"KEY_ESCAPE" |
- |
"KEY_ENTER" |
- |
"KEY_TAB" |
- |
"KEY_BACKSPACE" |
- |
"KEY_INSERT" |
- |
"KEY_DELETE" |
- |
"KEY_RIGHT" |
- |
"KEY_LEFT" |
- |
"KEY_DOWN" |
- |
"KEY_UP" |
- |
"KEY_PAGE_UP" |
- |
"KEY_PAGE_DOWN" |
- |
"KEY_HOME" |
- |
"KEY_END" |
- |
"KEY_CAPS_LOCK" |
- |
"KEY_SCROLL_LOCK" |
- |
"KEY_NUM_LOCK" |
- |
"KEY_PRINT_SCREEN" |
- |
"KEY_PAUSE" |
- |
"KEY_F1" |
- |
"KEY_F2" |
- |
"KEY_F3" |
- |
"KEY_F4" |
- |
"KEY_F5" |
- |
"KEY_F6" |
- |
"KEY_F7" |
- |
"KEY_F8" |
- |
"KEY_F9" |
- |
"KEY_F10" |
- |
"KEY_F11" |
- |
"KEY_F12" |
- |
"KEY_F13" |
- |
"KEY_F14" |
- |
"KEY_F15" |
- |
"KEY_F16" |
- |
"KEY_F17" |
- |
"KEY_F18" |
- |
"KEY_F19" |
- |
"KEY_F20" |
- |
"KEY_F21" |
- |
"KEY_F22" |
- |
"KEY_F23" |
- |
"KEY_F24" |
- |
"KEY_F25" |
- |
"KEY_KP_0" |
- |
"KEY_KP_1" |
- |
"KEY_KP_2" |
- |
"KEY_KP_3" |
- |
"KEY_KP_4" |
- |
"KEY_KP_5" |
- |
"KEY_KP_6" |
- |
"KEY_KP_7" |
- |
"KEY_KP_8" |
- |
"KEY_KP_9" |
- |
"KEY_KP_DECIMAL" |
- |
"KEY_KP_DIVIDE" |
- |
"KEY_KP_MULTIPLY" |
- |
"KEY_KP_SUBTRACT" |
- |
"KEY_KP_ADD" |
- |
"KEY_KP_ENTER" |
- |
"KEY_KP_EQUAL" |
- |
"KEY_LEFT_SHIFT" |
- |
"KEY_LEFT_CONTROL" |
- |
"KEY_LEFT_ALT" |
- |
"KEY_LEFT_SUPER" |
- |
"KEY_RIGHT_SHIFT" |
- |
"KEY_RIGHT_CONTROL" |
- |
"KEY_RIGHT_ALT" |
- |
"KEY_RIGHT_SUPER" |
- |
"KEY_MENU" |
- |
"MOUSE_X" |
- |
"MOUSE_Y" |
- |
"MOUSE_BUTTON_1" |
left |
"MOUSE_BUTTON_2" |
right |
"MOUSE_BUTTON_3" |
middle |
"MOUSE_BUTTON_4" |
- |
"MOUSE_BUTTON_5" |
- |
"MOUSE_BUTTON_6" |
- |
"MOUSE_BUTTON_7" |
- |
"MOUSE_BUTTON_8" |
- |
"SCROLL_OFFSET_X" |
- |
"SCROLL_OFFSET_Y" |
- |
"TOUCH_0_DOWN" |
- |
"TOUCH_0_X" |
- |
"TOUCH_0_Y" |
- |
"TOUCH_1_DOWN" |
- |
"TOUCH_1_X" |
- |
"TOUCH_1_Y" |
- |
"TOUCH_2_DOWN" |
- |
"TOUCH_2_X" |
- |
"TOUCH_2_Y" |
- |
"TOUCH_3_DOWN" |
- |
"TOUCH_3_X" |
- |
"TOUCH_3_Y" |
- |
"TOUCH_4_DOWN" |
- |
"TOUCH_4_X" |
- |
"TOUCH_4_Y" |
- |
"TOUCH_5_DOWN" |
- |
"TOUCH_5_X" |
- |
"TOUCH_5_Y" |
- |
"TOUCH_6_DOWN" |
- |
"TOUCH_6_X" |
- |
"TOUCH_6_Y" |
- |
"TOUCH_7_DOWN" |
- |
"TOUCH_7_X" |
- |
"TOUCH_7_Y" |
- |
"TOUCH_8_DOWN" |
- |
"TOUCH_8_X" |
- |
"TOUCH_8_Y" |
- |
"TOUCH_9_DOWN" |
- |
"TOUCH_9_X" |
- |
"TOUCH_9_Y" |
- |
"GAMEPAD_0_CONNECTED" |
- |
"GAMEPAD_0_BUTTON_A" |
- |
"GAMEPAD_0_BUTTON_B" |
- |
"GAMEPAD_0_BUTTON_X" |
- |
"GAMEPAD_0_BUTTON_Y" |
- |
"GAMEPAD_0_BUTTON_LEFT_BUMPER" |
- |
"GAMEPAD_0_BUTTON_RIGHT_BUMPER" |
- |
"GAMEPAD_0_BUTTON_BACK" |
- |
"GAMEPAD_0_BUTTON_START" |
- |
"GAMEPAD_0_BUTTON_GUIDE" |
- |
"GAMEPAD_0_BUTTON_LEFT_THUMB" |
- |
"GAMEPAD_0_BUTTON_RIGHT_THUMB" |
- |
"GAMEPAD_0_BUTTON_DPAD_UP" |
- |
"GAMEPAD_0_BUTTON_DPAD_RIGHT" |
- |
"GAMEPAD_0_BUTTON_DPAD_DOWN" |
- |
"GAMEPAD_0_BUTTON_DPAD_LEFT" |
- |
"GAMEPAD_0_AXIS_LEFT_X" |
- |
"GAMEPAD_0_AXIS_LEFT_Y" |
- |
"GAMEPAD_0_AXIS_RIGHT_X" |
- |
"GAMEPAD_0_AXIS_RIGHT_Y" |
- |
"GAMEPAD_0_AXIS_LEFT_TRIGGER" |
- |
"GAMEPAD_0_AXIS_RIGHT_TRIGGER" |
- |
"GAMEPAD_1_CONNECTED" |
- |
"GAMEPAD_1_BUTTON_A" |
- |
"GAMEPAD_1_BUTTON_B" |
- |
"GAMEPAD_1_BUTTON_X" |
- |
"GAMEPAD_1_BUTTON_Y" |
- |
"GAMEPAD_1_BUTTON_LEFT_BUMPER" |
- |
"GAMEPAD_1_BUTTON_RIGHT_BUMPER" |
- |
"GAMEPAD_1_BUTTON_BACK" |
- |
"GAMEPAD_1_BUTTON_START" |
- |
"GAMEPAD_1_BUTTON_GUIDE" |
- |
"GAMEPAD_1_BUTTON_LEFT_THUMB" |
- |
"GAMEPAD_1_BUTTON_RIGHT_THUMB" |
- |
"GAMEPAD_1_BUTTON_DPAD_UP" |
- |
"GAMEPAD_1_BUTTON_DPAD_RIGHT" |
- |
"GAMEPAD_1_BUTTON_DPAD_DOWN" |
- |
"GAMEPAD_1_BUTTON_DPAD_LEFT" |
- |
"GAMEPAD_1_AXIS_LEFT_X" |
- |
"GAMEPAD_1_AXIS_LEFT_Y" |
- |
"GAMEPAD_1_AXIS_RIGHT_X" |
- |
"GAMEPAD_1_AXIS_RIGHT_Y" |
- |
"GAMEPAD_1_AXIS_LEFT_TRIGGER" |
- |
"GAMEPAD_1_AXIS_RIGHT_TRIGGER" |
- |
"GAMEPAD_2_CONNECTED" |
- |
"GAMEPAD_2_BUTTON_A" |
- |
"GAMEPAD_2_BUTTON_B" |
- |
"GAMEPAD_2_BUTTON_X" |
- |
"GAMEPAD_2_BUTTON_Y" |
- |
"GAMEPAD_2_BUTTON_LEFT_BUMPER" |
- |
"GAMEPAD_2_BUTTON_RIGHT_BUMPER" |
- |
"GAMEPAD_2_BUTTON_BACK" |
- |
"GAMEPAD_2_BUTTON_START" |
- |
"GAMEPAD_2_BUTTON_GUIDE" |
- |
"GAMEPAD_2_BUTTON_LEFT_THUMB" |
- |
"GAMEPAD_2_BUTTON_RIGHT_THUMB" |
- |
"GAMEPAD_2_BUTTON_DPAD_UP" |
- |
"GAMEPAD_2_BUTTON_DPAD_RIGHT" |
- |
"GAMEPAD_2_BUTTON_DPAD_DOWN" |
- |
"GAMEPAD_2_BUTTON_DPAD_LEFT" |
- |
"GAMEPAD_2_AXIS_LEFT_X" |
- |
"GAMEPAD_2_AXIS_LEFT_Y" |
- |
"GAMEPAD_2_AXIS_RIGHT_X" |
- |
"GAMEPAD_2_AXIS_RIGHT_Y" |
- |
"GAMEPAD_2_AXIS_LEFT_TRIGGER" |
- |
"GAMEPAD_2_AXIS_RIGHT_TRIGGER" |
- |
"GAMEPAD_3_CONNECTED" |
- |
"GAMEPAD_3_BUTTON_A" |
- |
"GAMEPAD_3_BUTTON_B" |
- |
"GAMEPAD_3_BUTTON_X" |
- |
"GAMEPAD_3_BUTTON_Y" |
- |
"GAMEPAD_3_BUTTON_LEFT_BUMPER" |
- |
"GAMEPAD_3_BUTTON_RIGHT_BUMPER" |
- |
"GAMEPAD_3_BUTTON_BACK" |
- |
"GAMEPAD_3_BUTTON_START" |
- |
"GAMEPAD_3_BUTTON_GUIDE" |
- |
"GAMEPAD_3_BUTTON_LEFT_THUMB" |
- |
"GAMEPAD_3_BUTTON_RIGHT_THUMB" |
- |
"GAMEPAD_3_BUTTON_DPAD_UP" |
- |
"GAMEPAD_3_BUTTON_DPAD_RIGHT" |
- |
"GAMEPAD_3_BUTTON_DPAD_DOWN" |
- |
"GAMEPAD_3_BUTTON_DPAD_LEFT" |
- |
"GAMEPAD_3_AXIS_LEFT_X" |
- |
"GAMEPAD_3_AXIS_LEFT_Y" |
- |
"GAMEPAD_3_AXIS_RIGHT_X" |
- |
"GAMEPAD_3_AXIS_RIGHT_Y" |
- |
"GAMEPAD_3_AXIS_LEFT_TRIGGER" |
- |
"GAMEPAD_3_AXIS_RIGHT_TRIGGER" |
- |
"WINDOW_WIDTH" |
- |
"WINDOW_HEIGHT" |
- |
"WINDOW_ASPECT_RATIO" |
- |
"WINDOW_FULLSCREEN" |
- |
"VSYNC_ON" |
- |
"MOUSE_CATCHED" |
- |