- * Called when a button is pressed in player's inventory form, when form
- values are submitted or when the form is actively closed by the player.
- * Fields are sent for formspec elements which define a field, and the "quit"
- field is sent when actively closing the form by mouse click, keypress or
- through a button_exit[] element.
+ * Called when the server received input from `player` in a formspec with
+ the given `formname`. Specifically, this is called on any of the
+ following events:
+ * a button was pressed,
+ * Enter was pressed while the focus was on a text field
+ * a checkbox was toggled,
+ * something was selecteed in a drop-down list,
+ * a different tab was selected,
+ * selection was changed in a textlist or table,
+ * an entry was double-clicked in a textlist or table,
+ * a scrollbar was moved, or
+ * the form was actively closed by the player.
+ * Fields are sent for formspec elements which define a field. `fields`
+ is a table containing each formspecs element value (as string), with
+ the `name` parameter as index for each. The value depends on the
+ formspec element type:
+ * `button` and variants: If pressed, contains the user-facing button
+ text as value. If not pressed, is `nil`
+ * `field`, `textarea` and variants: Text in the field
+ * `dropdown`: Text of selected item
+ * `tabheader`: Tab index, starting with `"1"` (only if tab changed)
+ * `checkbox`: `"true"` if checked, `"false"` if unchecked
+ * `textlist`: See `minetest.explode_textlist_event`
+ * `table`: See `minetest.explode_table_event`
+ * `scrollbar`: See `minetest.explode_scrollbar_event`
+ * Special case: `["quit"]="true"` is sent when the user actively
+ closed the form by mouse click, keypress or through a button_exit[]
+ element.
+ * Special case: `["key_enter"]="true"` is sent when the user pressed
+ the Enter key and the focus was either nowhere (causing the formspec
+ to be closed) or on a button. If the focus was on a text field,
+ additionally, the index `key_enter_field` contains the name of the
+ text field. See also: `field_close_on_enter`.