Class InputModule
java.lang.Object
gaiasky.script.v2.impl.APIModule
gaiasky.script.v2.impl.InputModule
-
Field Summary
Fields inherited from class APIModule
api, em, logger, me, nameModifier and TypeFieldDescriptionprotected final APIv2Reference to API object.protected final EventManagerReference to event manager.protected final Logger.Logprotected final APIModuleReference to self.protected final StringModule name. -
Constructor Summary
ConstructorsConstructorDescriptionInputModule(EventManager em, APIv2 api, String name) Create a new module with the given attributes. -
Method Summary
Modifier and TypeMethodDescriptionvoiddisable()Disable all input events in Gaia Sky (mouse, keyboard, touchscreen, and gamepad) until a call toInputAPI.enable()is issued.voidenable()Enable all input events in Gaia Sky (mouse, keyboard, touchscreen, and gamepad).voidEvent notification call.voidBlock the execution until the Enter key is pressed.voidBlock the execution until any kind of input (keyboard, mouse, etc.) is received.voidwait_input(int code) Block the execution until the given key or button is pressed.
-
Constructor Details
-
InputModule
Create a new module with the given attributes.- Parameters:
api- Reference to the API class.name- Name of the module.
-
-
Method Details
-
disable
public void disable()Description copied from interface:InputAPIDisable all input events in Gaia Sky (mouse, keyboard, touchscreen, and gamepad) until a call toInputAPI.enable()is issued.After this method is called, Gaia Sky will not respond to any kind of input event.
-
enable
public void enable()Description copied from interface:InputAPIEnable all input events in Gaia Sky (mouse, keyboard, touchscreen, and gamepad). This call re-enables all input events, which were possibly disabled withInputAPI.disable(). -
wait_input
public void wait_input()Description copied from interface:InputAPIBlock the execution until any kind of input (keyboard, mouse, etc.) is received.- Specified by:
wait_inputin interfaceInputAPI
-
wait_enter
public void wait_enter()Description copied from interface:InputAPIBlock the execution until the Enter key is pressed.- Specified by:
wait_enterin interfaceInputAPI
-
wait_input
public void wait_input(int code) Description copied from interface:InputAPIBlock the execution until the given key or button is pressed.- Specified by:
wait_inputin interfaceInputAPI- Parameters:
code- The key or button code. Please seeInput.KeysandGSKeys.
-
notify
-