Package dev.adlin.vts4j.core.hotkey
Class HotkeyManager
java.lang.Object
dev.adlin.vts4j.core.hotkey.HotkeyManager
Manages hotkeys by loading available hotkeys, triggering them, and providing access to hotkey information.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable HotkeyfindByName(String hotkeyName) Returns the hotkey with the specified name.Returns a map of hotkeys with their IDs as keys.voidrefresh()Refreshes the internal cache by fetching hotkeys from VTube Studio.voidTriggers the specified hotkey by sending a request to the server.voidTriggers the hotkey with the specified name.
-
Constructor Details
-
HotkeyManager
-
-
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
Triggers the specified hotkey by sending a request to the server.- Parameters:
hotkey- The hotkey to be triggered. Cannot be null.
-
trigger
Triggers the hotkey with the specified name.- Parameters:
hotkeyName- The name of the hotkey to be triggered. Cannot be null.
-
getHotkeys
Returns a map of hotkeys with their IDs as keys.- Returns:
- A Map containing the hotkeys.
-
findByName
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.
-