Inputs Utilities: Mouse

Those marked with [O] are optional

  -- ImGui.IsMouseDown(...)
  -- Parameters: ImGuiMouseButton (button)
  -- Returns: bool (down)
  down = ImGui.IsMouseDown(ImGuiMouseButton.Right)
  
  -- ImGui.IsMouseClicked(...)
  -- Parameters: ImGuiMouseButton (button), bool (repeat) [O]
  -- Returns: bool (clicked)
  -- Overloads
  clicked = ImGui.IsMouseClicked(ImGuiMouseButton.Right)
  clicked = ImGui.IsMouseClicked(ImGuiMouseButton.Right, false)
  
  -- ImGui.IsMouseReleased(...)
  -- Parameters: ImGuiMouseButton (button)
  -- Returns: bool (released)
  released = ImGui.IsMouseReleased(ImGuiMouseButton.Right)
  
  -- ImGui.IsMouseDoubleClicked(...)
  -- Parameters: ImGuiMouseButton (button)
  -- Returns: bool (double_clicked)
  double_clicked = ImGui.IsMouseDoubleClicked(ImGuiMouseButton.Right)

  -- ImGui.IsMouseHoveringRect(...)
  -- Parameters: float (min_x), float (min_y), float(max_x), float(max_y), bool (clip) [O]
  -- Returns: bool (hovered)
  hovered = ImGui.IsMouseHoveringRect(0, 0, 100, 100)
  hovered = ImGui.IsMouseHoveringRect(0, 0, 100, 100, true)

  -- ImGui.IsAnyMouseDown()
  -- Returns: bool (any_mouse_down)
  any_mouse_down = ImGui.IsAnyMouseDown()

  -- ImGui.GetMousePos()
  -- Returns: float (x), float (y)
  x, y = ImGui.GetMousePos()

  -- ImGui.GetMousePosOnOpeningCurrentPopup()
  -- Returns: float (x), float (y)
  x, y = ImGui.GetMousePosOnOpeningCurrentPopup()

  -- ImGui.IsMouseDragging(...)
  -- Parameters: ImGuiMouseButton (button), float (lock_threshold) [O]
  -- Returns: bool (dragging)
  -- Overloads
  dragging = ImGui.IsMouseDragging(ImGuiMouseButton.Middle)
  dragging = ImGui.IsMouseDragging(ImGuiMouseButton.Middle, 0.5)

  -- ImGui.GetMouseDragDelta(...)
  -- Parameters: ImGuiMouseButton (button) [O], float (lock_threshold) [O]
  -- Returns: float (x), float (y)
  -- Overloads
  x, y = ImGui.GetMouseDragDelta()
  x, y = ImGui.GetMouseDragDelta(ImGuiMouseButton.Middle)
  x, y = ImGui.GetMouseDragDelta(ImGuiMouseButton.Middle, 0.5)

  -- ImGui.ResetMouseDragDelta(...)
  -- Parameters: ImGuiMouseButton (button) [O]
  -- Overloads
  ImGui.ResetMouseDragDelta()
  ImGui.ResetMouseDragDelta(ImGuiMouseButton.Middle)

  -- ImGui.GetMouseCursor()
  -- Returns: ImGuiMouseCursor (cursor)
  cursor = ImGui.GetMouseCursor()
  
  -- ImGui.SetMouseCursor(...)
  -- Parameters: ImGuiMouseCursor (cursor_type)
  ImGui.SetMouseCursor(ImGuiMouseCursor.Hand)

  -- ImGui.SetNextFrameWantCaptureMouse(...)
  -- Parameters: bool (want_capture_mouse_value)
  ImGui.SetNextFrameWantCaptureMouse(true)

  -- DEPRECATED (Use ImGui.SetNextFrameWantCaptureMouse())
  -- ImGui.CaptureMouseFromApp()
  -- Parameters: bool (want_capture_mouse_value) [O]
  -- Overloads
  ImGui.CaptureMouseFromApp()
  ImGui.CaptureMouseFromApp(true)

Last updated