Inputs Utilities: Keyboard

Those marked with [O] are optional

  -- ImGui.IsKeyDown(...)
  -- Parameters: int/ImGuiKey (key_index)
  -- Returns: bool (down)
  down = ImGui.IsKeyDown(0)
  down = ImGui.IsKeyDown(ImGuiKey.Z)
  
  -- ImGui.IsKeyPressed(...)
  -- Parameters: int/ImGuiKey (key_index), bool (repeat) [O]
  -- Returns: bool (pressed)
  -- Overloads
  pressed = ImGui.IsKeyPressed(0)
  pressed = ImGui.IsKeyPressed(ImGuiKey.Z)
  pressed = ImGui.IsKeyPressed(0, true)
  pressed = ImGui.IsKeyPressed(ImGuiKey.Z, true)
  
  -- ImGui.IsKeyReleased(...)
  -- Parameters: int/ImGuiKey (key_index)
  -- Returns: bool (released)
  released = ImGui.IsKeyReleased(0)
  released = ImGui.IsKeyReleased(ImGuiKey.Z)
  
  -- ImGui.GetKeyPressedAmount(...)
  -- Parameters: int/ImGuiKey (key_index), float (repeat_delay), float (rate)
  -- Returns: int (pressed_amount)  
  pressed_amount = ImGui.GetKeyPressedAmount(0, 0.5, 5)
  pressed_amount = ImGui.GetKeyPressedAmount(ImGuiKey.Z, 0.5, 5)

  -- ImGui.SetNextFrameWantCaptureKeyboard(...)
  -- Parameters bool (want_capture_keyboard_valvue)
  ImGui.SetNextFrameWantCaptureKeyboard(true)

  -- DEPRECATED (use ImGui.SetNextFrameWantCaptureKeyboard())
  -- ImGui.CaptureKeyboardFromApp(...)
  -- Parameters: bool (want_capture_keyboard_value) [O]
  -- Overloads
  ImGui.CaptureKeyboardFromApp()
  ImGui.CaptureKeyboardFromApp(false)

Last updated