mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2025-02-17 05:48:33 +00:00
968 B
968 B
js_gui__text_input
Text input GUI view
Displays a keyboard.
![Sample screenshot of the view](/Mirrors/unleashed-firmware/media/commit/38fb892cbbe412f67ff35acd2d9391ef5951be89/documentation/js/text_input.png)
let eventLoop = require("event_loop");
let gui = require("gui");
let textInputView = require("gui/text_input");
This module depends on the gui
module, which in turn depends on the
event_loop
module, so they must be imported in this order. It is also
recommended to conceptualize these modules first before using this one.
Example
For an example refer to the gui.js
example script.
View props
minLength
Smallest allowed text length
Type: number
maxLength
Biggest allowed text length
Type: number
Default: 32
header
Single line of text that appears above the keyboard
Type: string
View events
input
Fires when the user selects the "save" button and the text matches the length
constrained by minLength
and maxLength
.
Item type: string