1.. _lv_button: 2 3================== 4Button (lv_button) 5================== 6 7Overview 8******** 9 10Buttons have no new features compared to the :ref:`base_widget`. 11They are useful for semantic purposes and have slightly different default settings. 12 13Buttons, by default, differ from Base Widget in the following ways: 14 15- Not scrollable 16- Added to the default group 17- Default height and width set to :cpp:enumerator:`LV_SIZE_CONTENT` 18 19.. _lv_button_parts_and_styles: 20 21Parts and Styles 22**************** 23 24- :cpp:enumerator:`LV_PART_MAIN` The background of the button; uses the :ref:`typical 25 background style properties <typical bg props>`. 26 27.. _lv_button_usage: 28 29Usage 30***** 31 32There are no new features compared to :ref:`Base Widget <base_widget>`. 33 34 35 36.. _lv_button_events: 37 38Events 39****** 40 41- :cpp:enumerator:`LV_EVENT_VALUE_CHANGED` when the :cpp:enumerator:`LV_OBJ_FLAG_CHECKABLE` flag is 42 enabled and the Widget is clicked. The event happens on transition 43 to/from the checked state. 44 45.. admonition:: Further Reading 46 47 Learn more about :ref:`lv_obj_events` emitted by all Widgets. 48 49 Learn more about :ref:`events`. 50 51 52 53.. _lv_button_keys: 54 55Keys 56**** 57 58Note that the state of :cpp:enumerator:`LV_KEY_ENTER` is translated to 59:cpp:enumerator:`LV_EVENT_PRESSED`, :cpp:enumerator:`LV_EVENT_PRESSING` 60and :cpp:enumerator:`LV_EVENT_RELEASED` etc. 61 62.. admonition:: Further Reading 63 64 Learn more about :ref:`indev_keys`. 65 66 67 68.. _lv_button_example: 69 70Example 71******* 72 73.. include:: ../../examples/widgets/button/index.rst 74 75 76 77.. _lv_button_api: 78 79API 80*** 81