Renamed CaptureMouseFromApp() and CaptureKeyboardFromApp() to SetNextFrameWantCaptureMouse() and SetNextFrameWantCaptureKeyboard(). Added demo. (#5304, #4831, #4480, #533)
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals. Work in progress versions typically starts at XYY99 then bounce up to XYY00, XYY01 etc. when release tagging happens)
IMGUI_APIboolIsKeyReleased(ImGuiKeykey);// was key released (went from Down to !Down)?
IMGUI_APIintGetKeyPressedAmount(ImGuiKeykey,floatrepeat_delay,floatrate);// uses provided repeat rate/delay. return a count, most often 0 or 1 but might be >1 if RepeatRate is small enough that DeltaTime > RepeatRate
IMGUI_APIconstchar*GetKeyName(ImGuiKeykey);// [DEBUG] returns English name of the key. Those names a provided for debugging purpose and are not meant to be saved persistently not compared.
IMGUI_APIvoidCaptureKeyboardFromApp(boolwant_capture_keyboard_value=true);// attention: misleading name! manually override io.WantCaptureKeyboard flag next frame (said flag is entirely left for your application to handle). e.g. force capture keyboard when your widget is being hovered. This is equivalent to setting "io.WantCaptureKeyboard = want_capture_keyboard_value"; after the next NewFrame() call.
IMGUI_APIvoidSetNextFrameWantCaptureKeyboard(boolwant_capture_keyboard);// Override io.WantCaptureKeyboard flag next frame (said flag is left for your application to handle, typically when true it instructs your app to ignore inputs). e.g. force capture keyboard when your widget is being hovered. This is equivalent to setting "io.WantCaptureKeyboard = want_capture_keyboard"; after the next NewFrame() call.
// Inputs Utilities: Mouse
// - To refer to a mouse button, you may use named enums in your code e.g. ImGuiMouseButton_Left, ImGuiMouseButton_Right.
IMGUI_APIImGuiMouseCursorGetMouseCursor();// get desired cursor type, reset in ImGui::NewFrame(), this is updated during the frame. valid before Render(). If you use software rendering by setting io.MouseDrawCursor ImGui will render those for you
IMGUI_APIvoidSetMouseCursor(ImGuiMouseCursorcursor_type);// set desired cursor type
IMGUI_APIvoidCaptureMouseFromApp(boolwant_capture_mouse_value=true);// attention: misleading name! manually override io.WantCaptureMouse flag next frame (said flag is entirely left for your application to handle). This is equivalent to setting "io.WantCaptureMouse = want_capture_mouse_value;" after the next NewFrame() call.
IMGUI_APIvoidSetNextFrameWantCaptureMouse(boolwant_capture_mouse);// Override io.WantCaptureMouse flag next frame (said flag is left for your application to handle, typical when true it instucts your app to ignore inputs). This is equivalent to setting "io.WantCaptureMouse = want_capture_mouse;" after the next NewFrame() call.
// Clipboard Utilities
// - Also see the LogToClipboard() function to capture GUI into clipboard, or easily output text data to the clipboard.
@ -2961,16 +2961,19 @@ namespace ImGui
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
namespaceImGui
{
// OBSOLETED in 1.88 (from May 2022)
staticinlinevoidCaptureKeyboardFromApp(boolwant_capture_keyboard=true){SetNextFrameWantCaptureKeyboard(want_capture_keyboard);}// Renamed as name was misleading + removed default value.
staticinlinevoidCaptureMouseFromApp(boolwant_capture_mouse=true){SetNextFrameWantCaptureMouse(want_capture_mouse);}// Renamed as name was misleading + removed default value.
// OBSOLETED in 1.86 (from November 2021)
IMGUI_APIvoidCalcListClipping(intitems_count,floatitems_height,int*out_items_display_start,int*out_items_display_end);// Calculate coarse clipping for large list of evenly sized items. Prefer using ImGuiListClipper.
staticinlinevoidOpenPopupContextItem(constchar*str_id=NULL,ImGuiMouseButtonmb=1){OpenPopupOnItemClick(str_id,mb);}// Bool return value removed. Use IsWindowAppearing() in BeginPopup() instead. Renamed in 1.77, renamed back in 1.79. Sorry!
staticinlinevoidOpenPopupContextItem(constchar*str_id=NULL,ImGuiMouseButtonmb=1){OpenPopupOnItemClick(str_id,mb);}// Bool return value removed. Use IsWindowAppearing() in BeginPopup() instead. Renamed in 1.77, renamed back in 1.79. Sorry!
// OBSOLETED in 1.78 (from June 2020)
// Old drag/sliders functions that took a 'float power = 1.0' argument instead of flags.
// For shared code, you can version check at compile-time with `#if IMGUI_VERSION_NUM >= 17704`.