Module ctr.swkbd
The swkbd module.
Usage:
local swkbd = require("ctr.swkbd")
-
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
-
TYPE_NORMAL
-
-
TYPE_QWERTY
-
-
TYPE_NUMPAD
-
-
TYPE_WESTERN
-
-
ANYTHING
-
-
NOTEMPTY
-
-
NOTEMPTY_NOTBLANK
-
-
NOTBLANK_NOTEMPTY
-
-
NOTBLANK
-
-
FIXEDLEN
-
-
:launch ([maxLength=max])
-
Launch the keyboard applet.
Parameters:
- maxLength
integer
maximum text length (max 65000)
(default max)
Returns:
-
string
text (UTF-8)
-
integer
button pressed (1, 2 or 3)
Or
-
nil
-
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 "")