File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
examples/Braccio_Learn_and_Repeat Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 5
5
#define COLOR_LIGHT_TEAL 0x62AEB2
6
6
#define COLOR_ORANGE 0xE47128
7
7
8
+ // ENTER button
9
+ #define BUTTON_ENTER 6
10
+
8
11
enum states {
9
12
RECORD,
10
13
REPLAY,
@@ -28,12 +31,8 @@ static void eventHandlerMenu(lv_event_t * e) {
28
31
lv_event_code_t code = lv_event_get_code (e);
29
32
lv_obj_t * obj = lv_event_get_target (e);
30
33
31
- if (code == LV_EVENT_KEY && lv_indev_get_key (lv_indev_get_act ()) == LV_KEY_HOME) {
32
- state = ZERO_POSITION;
33
- return ;
34
- }
35
34
36
- if (code == LV_EVENT_CLICKED) {
35
+ if (code == LV_EVENT_CLICKED || (code == LV_EVENT_KEY && Braccio. getKey () == BUTTON_ENTER) ) {
37
36
uint32_t id = lv_btnmatrix_get_selected_btn (obj);
38
37
const char * txt = lv_btnmatrix_get_btn_text (obj, id);
39
38
You can’t perform that action at this time.
0 commit comments