diff options
author | rubenwardy <rubenwardy@gmail.com> | 2016-08-07 16:22:50 +0100 |
---|---|---|
committer | rubenwardy <rubenwardy@gmail.com> | 2016-08-27 13:05:01 +0100 |
commit | e10fee00011f6c1ef8ee5b884adb11013954a1c9 (patch) | |
tree | ec90d06054beba47c2270ff722da816ccd09a28a /doc | |
parent | 4330c63ea40a75d4b8fcf71dc749fed714b22a44 (diff) | |
download | minetest-e10fee00011f6c1ef8ee5b884adb11013954a1c9.tar.gz minetest-e10fee00011f6c1ef8ee5b884adb11013954a1c9.tar.bz2 minetest-e10fee00011f6c1ef8ee5b884adb11013954a1c9.zip |
Allow fields to choose whether they close on enter press
Diffstat (limited to 'doc')
-rw-r--r-- | doc/lua_api.txt | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 440edd963..579fe796e 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -1503,17 +1503,23 @@ examples. * If `true` the background is clipped to formspec size (`x` and `y` are used as offset values, `w` and `h` are ignored) -#### `pwdfield[<X>,<Y>;<W>,<H>;<name>;<label>]` +#### `pwdfield[<X>,<Y>;<W>,<H>;<name>;<label>;<close_on_enter>]` * Textual password style field; will be sent to server when a button is clicked +* When enter is pressed in field, fields.key_enter_field will be sent with the name + of this field. * `x` and `y` position the field relative to the top left of the menu * `w` and `h` are the size of the field * Fields are a set height, but will be vertically centred on `h` * Position and size units are inventory slots * `name` is the name of the field as returned in fields to `on_receive_fields` * `label`, if not blank, will be text printed on the top left above the field +* `close_on_enter` (optional) is whether the form should accept and close when enter is + pressed in this field. Defaults to true. -#### `field[<X>,<Y>;<W>,<H>;<name>;<label>;<default>]` +#### `field[<X>,<Y>;<W>,<H>;<name>;<label>;<default>;<close_on_enter>]` * Textual field; will be sent to server when a button is clicked +* When enter is pressed in field, fields.key_enter_field will be sent with the name + of this field. * `x` and `y` position the field relative to the top left of the menu * `w` and `h` are the size of the field * Fields are a set height, but will be vertically centred on `h` @@ -1524,12 +1530,18 @@ examples. * `default` may contain variable references such as `${text}'` which will fill the value from the metadata value `text` * **Note**: no extra text or more than a single variable is supported ATM. +* `close_on_enter` (optional) is whether the form should accept and close when enter is + pressed in this field. Defaults to true. -#### `field[<name>;<label>;<default>]` +#### `field[<name>;<label>;<default>;<close_on_enter>]` * As above, but without position/size units +* When enter is pressed in field, fields.key_enter_field will be sent with the name + of this field. * Special field for creating simple forms, such as sign text input * Must be used without a `size[]` element * A "Proceed" button will be added automatically +* `close_on_enter` (optional) is whether the form should accept and close when enter is + pressed in this field. Defaults to true. #### `textarea[<X>,<Y>;<W>,<H>;<name>;<label>;<default>]` * Same as fields above, but with multi-line input |