ImGuiIO
Input typesno constructorsource
Used in get_io, also see set_hotkey and GuiDrawContext::key_picker.
- Functions are static, not class methods expecting
self(call withget_io().keydown(key), not:) - The clicked/pressed actions only work in
ON.GUIFRAME(they are true for one GUIFRAME), but get_io() can be used anywhere for the other parts. - You can use
KEYor other standard virtual keycodes < 0xFF to indexkeys[]or in the functions. - You can use chords
KEY.OL_MOD_CTRL | KEY.Xin the keydown/keypressed/keyreleased functions. - You can also use mouse buttons (e.g.
KEY.OL_MOUSE_1) or anything returned by GuiDrawContext:key_picker in the keydown/keypressed/keyreleased functions. - A modifier key as a keycode (
keypressed(KEY.LCONTROL)) is not the same as modifier flags OL_MOD_...keypressed(KEY.OL_MOD_CTRL)won't work,keypressed(KEY.OL_MOD_CTRL | KEY.LSHIFT)will trigger on "Ctrl+Shift" but not "Shift+Ctrl" - All held modifiers must be present in the chord, e.g.
keypressed(KEY.OL_MOD_CTRL | KEY.X)won't trigger when Ctrl+Shift+X is pressed,keydown(KEY.Y)won't trigger when Ctrl+Y is pressed. - Most fields are read only, except
wantkeyboard,wantmouseandshowcursor. - Setting
wantkeyboardearly (e.g. already whenmodifierdown(KEY.OL_MOD_CTRL | KEY.X)) will prevent the game and UI from reacting to your actual combo later (e.g.keypressed(KEY.OL_MOD_CTRL | KEY.X)) - Gamepad is basically XINPUT_GAMEPAD but variables are renamed and values are normalized to -1.0..1.0 range.
Fields
wantkeyboard
booleanproperty
True if anyone else (i.e. some input box, OL hotkey) is already capturing keyboard or reacted to this keypress and you probably shouldn't. Set this to true every GUIFRAME while you want to capture keyboard and disable UI key bindings and game keys. Won't affect UI or game keys on this frame though, that train has already sailed. Also see Bucket::Overlunky for other ways to override key bindings. Do not set this to false, unless you want the player input to bleed through input fields.
sourcewantmouse
booleanproperty
True if anyone else (i.e. hovering some window) is already capturing mouse and you probably shouldn't. Set this to true if you want to capture mouse and override UI mouse binding.
sourceMethods
gamepads
function ImGuiIO.gamepads(index: integer): Gamepadindex:integer
Returns Gamepad
Gamepad gamepads(int index) This is the XInput index 1..4, might not be the same as the player slot.
sourcekeydown
function ImGuiIO.keydown(keycode: integer): booleankeycode:integer
Returns boolean
function ImGuiIO.keydown(key: integer): booleankey:integer
Returns boolean
Returns true if key or chord is down. bool keydown(KEY keychord) bool keydown(char key)
sourcekeypressed
function ImGuiIO.keypressed(keycode: integer): booleankeycode:integer
Returns boolean
function ImGuiIO.keypressed(keycode: integer, repeat: boolean): booleankeycode:integerrepeat:boolean
Returns boolean
function ImGuiIO.keypressed(key: integer): booleankey:integer
Returns boolean
function ImGuiIO.keypressed(key: integer, repeat: boolean): booleankey:integerrepeat:boolean
Returns boolean
Returns true if key or chord was pressed this GUIFRAME. bool keypressed(KEY keychord, bool repeat = false) bool keypressed(char key, bool repeat = false)
sourcekeyreleased
function ImGuiIO.keyreleased(keycode: integer): booleankeycode:integer
Returns boolean
function ImGuiIO.keyreleased(key: integer): booleankey:integer
Returns boolean
Returns true if key or chord was released this GUIFRAME. bool keyreleased(KEY keychord) bool keyreleased(char key)
sourcemodifierdown
function ImGuiIO.modifierdown(chord: integer): booleanchord:integer
Returns boolean
bool modifierdown(KEY keychord) Returns true if modifiers in chord are down, ignores other keys in chord.
source