Class ImHotKey

java.lang.Object
de.luckymcdev.foundryengine.client.imgui.hotkey.ImHotKey

public class ImHotKey extends Object
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
     
    static final class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final long
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    edit(ImHotKey.HotKey[] hotkeys, String popupModal)
    Renders the hotkey editor inside a named modal popup.
    int
    Returns the index of the hotkey currently held down, or -1 if none matches.
    getHotKeyLabel(long functionKeys, @Nullable net.minecraft.network.chat.Component functionName)
    Builds a display string such as "Ctrl + Shift + S", or "Save (Ctrl + Shift + S)" if functionName is non-null.
    boolean
    Returns true on the frame a single HotKey is pressed (fire-and-forget convenience).
    long
    pack(int... imguiKeys)
    Packs one or more ImGuiKey values into the ordered bitfield format used by getHotKey().
    void
    Renders the hotkey editor inline (inside a panel or window).
    void
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • ImHotKey

      public ImHotKey()
  • Method Details

    • setOnHotKeySet

      public void setOnHotKeySet(Runnable r)
    • getHotKeyLabel

      public String getHotKeyLabel(long functionKeys, @Nullable net.minecraft.network.chat.Component functionName)
      Builds a display string such as "Ctrl + Shift + S", or "Save (Ctrl + Shift + S)" if functionName is non-null.
    • render

      public void render(ImHotKey.HotKey[] hotkeys)
      Renders the hotkey editor inline (inside a panel or window). The editor is rendered only when hotkeys.length > 0.
    • edit

      public void edit(ImHotKey.HotKey[] hotkeys, String popupModal)
      Renders the hotkey editor inside a named modal popup. Call ImGui.openPopup(popupModal) to open it.
    • getHotKey

      public int getHotKey(ImHotKey.HotKey[] hotkeys)
      Returns the index of the hotkey currently held down, or -1 if none matches.
    • pack

      public long pack(int... imguiKeys)
      Packs one or more ImGuiKey values into the ordered bitfield format used by getHotKey(). Keys are sorted by keyboard layout order for consistent matching.
    • isPressed

      public boolean isPressed(ImHotKey.HotKey hotkey)
      Returns true on the frame a single HotKey is pressed (fire-and-forget convenience).