Skip to content

lvgl.momentaryButton

Syntax

lvgl.momentaryButton([parent], {settings})

parent:momentaryButton({settings})

Parameters

See the API page for parameter description and common settings.

Button specific settings:

NameTypeDescriptionDefault if not set
textString or FunctionText to be displayed in the button.Empty string
pressFunctionCalled when the user first taps on the button. nil
releaseFunctionCalled when the user releases the ENTER key or stops touching the screen. nil
activeFunctionSet the enabled / disabled state. Return value must be a boolean - true to enable the control, false to disable.nil
colorColor or FunctionSets the background color for the button.EdgeTx button style color - PRIMARY2 theme color.
textColorColor or FunctionSets the text color for the button label.EdgeTx button style color - SECONDARY1 theme color.
cornerRadiusNumberSets the radius for the corners of the button.EdgeTx button style radius.
fontFont value or FunctionSets the font size.
E.G.:
- MIDSIZE
- DBLSIZE
STDSIZE

Notes

Unlike the standard button the press function is called immediately when the user taps on the screen or presses the ENTER key when the momentary button is selected. The button shows in the 'checked' state until the user releases the ENTER key or stops touching the screen.

Return values

LVGL object

API Status

AvailStatusComment
BW radiosfalse
Color radiostrueactiveOnly available for One-Time scripts and widgets running in full screen mode.

Change log

EdgeTX versionChange
2.11.0Introduced