Module ctr.swkbd

The swkbd module.

Usage:

    local swkbd = require("ctr.swkbd")

Functions

keyboard ([type=TYPE_NORMAL[, buttons=2[, maxLength=max]]]) Create a software keyboard.

Constants

TYPE_NORMAL
TYPE_QWERTY
TYPE_NUMPAD
TYPE_WESTERN
ANYTHING
NOTEMPTY
NOTEMPTY_NOTBLANK
NOTBLANK_NOTEMPTY
NOTBLANK
FIXEDLEN

Keyboard object

:launch ([maxLength=max]) Launch the keyboard applet.
:setInitialText ([text=""]) Set the initial text in the textbox.
:setHintText ([text=""]) Set the text displayed in the textbox when it's empty.


Functions

keyboard ([type=TYPE_NORMAL[, buttons=2[, maxLength=max]]])
Create a software keyboard.

Parameters:

  • type TYPE keyboard type. (default TYPE_NORMAL)
  • buttons integer number of buttons, can be 1, 2 or 3. Will default to 2 if the number isn't 1, 2 or 3 (default 2)
  • maxLength integer maximum length of the text. (maximum 65000) (default max)

Returns:

    keyboard a software keyboard object

Constants

TYPE_NORMAL
  • TYPE_NORMAL
TYPE_QWERTY
  • TYPE_QWERTY
TYPE_NUMPAD
  • TYPE_NUMPAD
TYPE_WESTERN
  • TYPE_WESTERN
ANYTHING
  • ANYTHING
NOTEMPTY
  • NOTEMPTY
NOTEMPTY_NOTBLANK
  • NOTEMPTY_NOTBLANK
NOTBLANK_NOTEMPTY
  • NOTBLANK_NOTEMPTY
NOTBLANK
  • NOTBLANK
FIXEDLEN
  • FIXEDLEN

Keyboard object

:launch ([maxLength=max])
Launch the keyboard applet.

Parameters:

  • maxLength integer maximum text length (max 65000) (default max)

Returns:

  1. string text (UTF-8)
  2. integer button pressed (1, 2 or 3)

Or

  1. nil
  2. string error. In case of an "OUTOFMEM" error, this function will throw an error instead of returning.
:setInitialText ([text=""])
Set the initial text in the textbox.

Parameters:

  • text string initial text (default "")
:setHintText ([text=""])
Set the text displayed in the textbox when it's empty.

Parameters:

  • text string hint text (default "")
generated by LDoc 1.4.3 Last updated 2017-06-05 14:35:27