User Tools

Site Tools


addons:functions:imgui.io

ImGui IO Table

The ImGui IO table holds various I/O related properties and information about the current state of ImGui.


Accessing ImGui IO Table

Within an addon, you can access the ImGui IO table via 'imgui.io'.

local io = imgui.io;

ImGui IO Table Notes

Please note! The imgui.io table differs from the main imgui functions! Please be sure to read the following notes carefully!!

The imgui.io table differs from the functions found within the 'imgui' table. The io table is implemented in a different manner and can make use of certain types such as ImVec2, ImVec4, etc. Because of this, things are used a little differently. But it should be straight forward enough.

Here are some examples of how you can make use of the imgui.io table properties:

-- Getting the display size.. (ImVec2)
local display_x = imgui.io.DisplaySize.x;
local display_y = imgui.io.DisplaySize.y;
 
-- Setting the display size.. (ImVec2)
imgui.io.DisplaySize = ImVec2(100, 100);
 
-- Obtaining if the left mouse button is down..
local isMouseDown = imgui.io.MouseDown[0];
 
-- Setting if the left mouse button is down manually..
local mouseDown = imgui.io.MouseDown;
mouseDown[0] = true;
imgui.io.MouseDown = mouseDown;

Any property that is within an array must be done in the above manner. You cannot directly index these arrays and set their values.
You must pull the array, edit it, then reset the full array to make changes.


ImGui IO Table Properties

The table holds the following properties:

  • ImVec2 DisplaySize - The current display size for ImGui to render within.
  • float DeltaTime - Time elapsed since the last frame.
  • float IniSavingRate - Maximum time between saving current window positions.
  • const char* IniFilename - The path to the imgui.ini file.
  • const char* LogFilename - The path to the imgui_log.txt file.
  • float MouseDoubleClickTime - Time for a double-click to register.
  • float MouseDoubleClickMaxDist - Distance threshold to stay in to validate a double-click (in pixels).
  • float MouseDragThreshold - Distance threshold to before considering we are dragging.
  • int KeyMap[19] - Map of indices into the KeysDown entries array. (Used to translate key codes.)
  • float KeyRepeatDelay - Time before a key begins repeating while being held down.
  • float KeyRepeatRate - Time between each key repeat while being held down.
  • void* UserData - Custom defined user data.
  • ImFontAtlas* Fonts - Current atlas of loaded fonts. (Not implemented for Lua usage.)
  • float FontGlobalScale - Global scale for all fonts to use.
  • bool FontAllowUserScaling - Allows users to scroll in and out of ImGui when enabled.
  • ImVec2 DisplayFramebufferScale - Used for retina displays where window coords differ from frame buffer coords.
  • ImVec2 DisplayVisibleMin - Not used.
  • ImVec2 DisplayVisibleMax - Not used.
  • bool WordMovementUsesAltKey - Not used.
  • bool ShortcutsUseSuperKey - Not used.
  • bool DoubleClickSelectsWord - Not used.
  • bool MultiSelectUsesSuperKey - Not used.
  • ImVec2 MousePos - The current position of the mouse.
  • bool MouseDown[5] - Current mouse button states. (Starts at index 0: left, right, middle, +extras)
  • float MouseWheel - Current mouse wheel rotation offset.
  • bool MouseDrawCursor - Enables ImGui to render a cursor.
  • bool KeyCtrl - Flag that is true if Ctrl is pressed.
  • bool KeyShift - Flag that is true if Shift is pressed.
  • bool KeyAlt - Flag that is true if Alt is pressed.
  • bool KeySuper - Flag that is true if Windows key is pressed.
  • bool KeysDown[512] - Array of flags set to true if various keys are down.
  • ImWchar InputCharacters[16 + 1] - List of characters currently being input.
  • bool WantCaptureMouse - Flag that is true if ImGui is currently capturing the mouse.
  • bool WantCaptureKeyboard - Flag that is true if ImGui is currently capturing the keyboard.
  • bool WantTextInput - Flag that is true if ImGui is currently capturing input.
  • float Framerate - Estimated frames per second.
  • int MetricsAllocs - Number of current memory allocations.
  • int MetricsRenderVertices - Number of current vertices being rendered.
  • int MetricsRenderIndices - Number of indices being rendered.
  • int MetricsActiveWindows - Number of windows that are currently active.
  • ImVec2 MousePosPrev - The previous mouse position during the last frame.
  • ImVec2 MouseDelta - The current mouse delta.
  • bool MouseClicked[5] - Array of flags that determine if a mouse button was clicked since the last frame.
  • ImVec2 MouseClickedPos[5] - Array of positions that hold where a given button clicked since the last frame.
  • float MouseClickedTime[5] - Array of times that hold when a given button was clicked since the last frame.
  • bool MouseDoubleClicked[5] - Array of flags that hold if a mouse button was double clicked since the last frame.
  • bool MouseReleased[5] - Array of flags that hold if a mouse button was released since the last frame.
  • bool MouseDownOwned[5] - Array of flags that hold if a click started within an ImGui controls space since the last frame.
  • float MouseDownDuration[5] - Array of time that holds the duration since a mouse button was clicked down.
  • float MouseDownDurationPrev[5] - Array of time that holds the duration since a mouse button was clicked down (previously).
  • float MouseDragMaxDistanceSqr[5] - Array of distance (square rooted) that the mouse has traveled since a mouse click.
  • float KeysDownDuration[512] - Array of time that holds the duration of a key down.
  • float KeysDownDurationPrev[512] - Array of time that holds the duration of a key down (previously).
addons/functions/imgui.io.txt · Last modified: 2016/06/22 00:23 by atom0s