Helpers.Input Functions

The table Helpers.Input holds functions to manage the user input.

  • HL.Input.CheckJoystick(waitKey, waitRelease)
  • HL.Input.CheckKeyboard(keyList, waitKey, waitRelease)


HL.Input.CheckJoystick(waitKey, waitRelease)

dir, fire = HL.Input.CheckJoystick(waitKey, waitRelease)

Wait for a joystick button press or for any direction detected.

INPUT

  • waitKey : TRUE to wait until a button/direction is triggered, FALSE to execute a scan and return immediately
  • waitRelease : TRUE to wait until a pressed button/direction is released, FALSE to return immediatly as soon as the button/direction
    is pressed.

OUTPUT

  • dir : The numeric code of the direction detected or -1 if no direction was detected.
  • fire : The numeric code of the button pressed or -1 if no button was detected.


HL.Input.CheckKeyboard(keyList, waitKey, waitRelease)

key = HL.Input.CheckKeyboard(keyList, waitKey, waitRelease)

Wait for a key press from a list of allowed keys.

INPUT

  • keyList : A table of all allowed keys, you can set it to 'ANY' to detect keypresses coming from any keys.
  • waitKey : TRUE to wait until a key is pressed, FALSE to make a scan and return immediatly
  • waitRelease : TRUE to wait until a pressed key is released, FALSE to return immediatly as soon as the key is pressed

OUTPUT

  • key : A string representing the pressed key or an empty string if no key has been pressed (this last case is valid only if you have set waitKey = FALSE).
hollywoodlibs/helpers/input.txt · Ultima modifica: 2016/10/11 15:58 da admin
CC Attribution-Noncommercial 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0