Package group24.escaperoom.control
Class ControlsManager
java.lang.Object
group24.escaperoom.control.ControlsManager
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic interfacestatic final classstatic enumstatic classstatic enum -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidClear any registered non-permanent inputs and overrides.static InputmatchesInput(int code, ControlsManager.InputMethod method, InputModifier... modifiers) Check if a keycode, input method, and list of input modifiers corresponds to a known Input.static voidpopOverride(InputOverride override) static voidstatic voidpushOverride(InputOverride override) Get all currently registered key bindsstatic voidregisterInput(Input input, ControlsManager.InputType type, ControlsManager.InputAction action) Register a new input.static voidregisterPermanentInput(Input input, ControlsManager.InputType type, ControlsManager.InputAction action) Permanently register a new input.static voidsetKeyboardEnabled(boolean keyboardEnabled) Disable handling non-permanent controls.
-
Constructor Details
-
ControlsManager
public ControlsManager()
-
-
Method Details
-
setKeyboardEnabled
public static void setKeyboardEnabled(boolean keyboardEnabled) Disable handling non-permanent controls. Typically used when in a text-box -
registerPermanentInput
public static void registerPermanentInput(Input input, ControlsManager.InputType type, ControlsManager.InputAction action) Permanently register a new input. These inputs can never be removed or cleared. These inputs always resolve before normal inputs. Any inputs registered for the same input resolve in order of registration. -
registerInput
public static void registerInput(Input input, ControlsManager.InputType type, ControlsManager.InputAction action) Register a new input. These inputs always resolve after permanent inputs. Any inputs registered for the same input resolve in order of registration. -
clearRegisteredInputs
public static void clearRegisteredInputs()Clear any registered non-permanent inputs and overrides. -
pushOverride
-
popOverride
-
processInputs
public static void processInputs() -
registedMappings
Get all currently registered key binds -
matchesInput
public static Input matchesInput(int code, ControlsManager.InputMethod method, InputModifier... modifiers) Check if a keycode, input method, and list of input modifiers corresponds to a known Input. Used with listeners rather than input registration, though is *much* slower and is thus recommended against using when possible. Ignores whether keyboard is enabled or not, along with if inputs for this key have been processed this input cycle.
-