-
- All Implemented Interfaces:
public class KeybindsReads and writes a configuration of key bindings to a JSON file.
-
-
Field Summary
Fields Modifier and Type Field Description private Map<ActionFromKey, KeyCode>configpublic final static KeybindsINSTANCE
-
Method Summary
Modifier and Type Method Description final Optional<KeyCode>get(ActionFromKey action)Retrieve the keys bound to a certain action. final Unitset(ActionFromKey action, KeyCode key)Associate an action with a set of keys. final Unitsave()Write the binds to the file system. final Unitload()Load the binds from a file in the file system, reverting to classpath on failure. final Map<ActionFromKey, KeyCode>getConfig()The currently loaded configuration. final UnitsetConfig(Map<ActionFromKey, KeyCode> config)The currently loaded configuration. -
-
Method Detail
-
get
final Optional<KeyCode> get(ActionFromKey action)
Retrieve the keys bound to a certain action.
-
set
final Unit set(ActionFromKey action, KeyCode key)
Associate an action with a set of keys.
-
load
final Unit load()
Load the binds from a file in the file system, reverting to classpath on failure.
-
getConfig
final Map<ActionFromKey, KeyCode> getConfig()
The currently loaded configuration.
-
setConfig
final Unit setConfig(Map<ActionFromKey, KeyCode> config)
The currently loaded configuration.
-
-
-
-