mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
WioTrackerL1: add joystick left and right for new UI
This commit is contained in:
parent
8f1ccb65ae
commit
cb8ca91d27
3 changed files with 18 additions and 0 deletions
|
|
@ -494,6 +494,20 @@ void UITask::loop() {
|
||||||
c = handleLongPress(KEY_ENTER);
|
c = handleLongPress(KEY_ENTER);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(WIO_TRACKER_L1)
|
||||||
|
ev = joystick_left.check();
|
||||||
|
if (ev == BUTTON_EVENT_CLICK) {
|
||||||
|
c = checkDisplayOn(KEY_LEFT);
|
||||||
|
} else if (ev == BUTTON_EVENT_LONG_PRESS) {
|
||||||
|
c = handleLongPress(KEY_LEFT);
|
||||||
|
}
|
||||||
|
ev = joystick_right.check();
|
||||||
|
if (ev == BUTTON_EVENT_CLICK) {
|
||||||
|
c = checkDisplayOn(KEY_RIGHT);
|
||||||
|
} else if (ev == BUTTON_EVENT_LONG_PRESS) {
|
||||||
|
c = handleLongPress(KEY_RIGHT);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (c != 0 && curr) {
|
if (c != 0 && curr) {
|
||||||
curr->handleInput(c);
|
curr->handleInput(c);
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,8 @@ WioTrackerL1SensorManager sensors = WioTrackerL1SensorManager(nmea);
|
||||||
#ifdef DISPLAY_CLASS
|
#ifdef DISPLAY_CLASS
|
||||||
DISPLAY_CLASS display;
|
DISPLAY_CLASS display;
|
||||||
MomentaryButton user_btn(PIN_USER_BTN, 1000, true);
|
MomentaryButton user_btn(PIN_USER_BTN, 1000, true);
|
||||||
|
MomentaryButton joystick_left(JOYSTICK_LEFT, 1000, true);
|
||||||
|
MomentaryButton joystick_right(JOYSTICK_RIGHT, 1000, true);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool radio_init() {
|
bool radio_init() {
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,8 @@ extern WioTrackerL1SensorManager sensors;
|
||||||
#ifdef DISPLAY_CLASS
|
#ifdef DISPLAY_CLASS
|
||||||
extern DISPLAY_CLASS display;
|
extern DISPLAY_CLASS display;
|
||||||
extern MomentaryButton user_btn;
|
extern MomentaryButton user_btn;
|
||||||
|
extern MomentaryButton joystick_left;
|
||||||
|
extern MomentaryButton joystick_right;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool radio_init();
|
bool radio_init();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue