Skip to main content

Decrease Control Value (ui_element.decrease)

This function is available in versions after 20260507

Declaration​

ok, info_or_err = ui_element.decrease(selector_or_element [, options ])

Parameters​

  • selector_or_element
    Table. A selector, an element returned by a query, or a coordinate table { x = X, y = Y }.
  • options
    Optional, table. Use steps to provide a step parameter.

Returns​

  • ok
    Boolean. true on success, nil on failure.
  • info_or_err
    Table on success, string failure reason on failure.

Description​

Use this API for sliders, pickers, and other controls that support adjustment. The target control decides how much each call decreases. For precise control, call it in a Lua loop and read the result.

Example​

local ui_element = require("ui_element")

ui_element.decrease({
role = "picker",
index = 1,
}, {
steps = 2,
})