Fix #39 hardware touch whoopsie
This commit is contained in:
+4
-1
@@ -64,10 +64,11 @@ class MenuToolbar: public FormGroup {
|
|||||||
void onEvent(event_t event) override
|
void onEvent(event_t event) override
|
||||||
{
|
{
|
||||||
if (event == EVT_KEY_BREAK(KEY_PGDN) || event == EVT_KEY_LONG(KEY_PGDN) || event == EVT_KEY_BREAK(KEY_PGUP)) {
|
if (event == EVT_KEY_BREAK(KEY_PGDN) || event == EVT_KEY_LONG(KEY_PGDN) || event == EVT_KEY_BREAK(KEY_PGUP)) {
|
||||||
|
#if defined(HARDWARE_TOUCH)
|
||||||
if (current != children.end()) {
|
if (current != children.end()) {
|
||||||
static_cast<MenuToolbarButton *>(*current)->onTouchEnd(0,0);
|
static_cast<MenuToolbarButton *>(*current)->onTouchEnd(0,0);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
current = IS_KEY_LONG(event) || event == EVT_KEY_BREAK(KEY_PGUP) ?
|
current = IS_KEY_LONG(event) || event == EVT_KEY_BREAK(KEY_PGUP) ?
|
||||||
current == children.end() ?
|
current == children.end() ?
|
||||||
--current:
|
--current:
|
||||||
@@ -83,7 +84,9 @@ class MenuToolbar: public FormGroup {
|
|||||||
|
|
||||||
if (current != children.end()) {
|
if (current != children.end()) {
|
||||||
auto button = static_cast<MenuToolbarButton *>(*current);
|
auto button = static_cast<MenuToolbarButton *>(*current);
|
||||||
|
#if defined(HARDWARE_TOUCH)
|
||||||
button->onTouchEnd(0,0);
|
button->onTouchEnd(0,0);
|
||||||
|
#endif
|
||||||
scrollTo(button);
|
scrollTo(button);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
Reference in New Issue
Block a user