Class HotkeyManager

java.lang.Object
dev.adlin.vts4j.core.hotkey.HotkeyManager

public class HotkeyManager extends Object
Manages hotkeys by loading available hotkeys, triggering them, and providing access to hotkey information.
  • Constructor Details

    • HotkeyManager

      public HotkeyManager(VTSClient client)
  • Method Details

    • refresh

      public void refresh()
      Refreshes the internal cache by fetching hotkeys from VTube Studio. This performs a blocking network request and overwrites existing cached data. Call this method if hotkeys have been modified in the VTube Studio UI.
    • trigger

      public void trigger(@NotNull @NotNull Hotkey hotkey)
      Triggers the specified hotkey by sending a request to the server.
      Parameters:
      hotkey - The hotkey to be triggered. Cannot be null.
    • trigger

      public void trigger(@NotNull @NotNull String hotkeyName)
      Triggers the hotkey with the specified name.
      Parameters:
      hotkeyName - The name of the hotkey to be triggered. Cannot be null.
    • getHotkeys

      public Map<String,Hotkey> getHotkeys()
      Returns a map of hotkeys with their IDs as keys.
      Returns:
      A Map containing the hotkeys.
    • findByName

      @Nullable public @Nullable Hotkey findByName(String hotkeyName)
      Returns the hotkey with the specified name.
      Parameters:
      hotkeyName - The name of the hotkey to retrieve.
      Returns:
      The Hotkey object with the specified name, or null if not found.