More beeps

This commit is contained in:
Bertrand Songis
2021-02-18 18:37:51 +01:00
parent 894fbd08ab
commit 8f4bb417ba
2 changed files with 3 additions and 0 deletions
+2
View File
@@ -38,6 +38,7 @@ void Button::onEvent(event_t event)
if (event == EVT_KEY_BREAK(KEY_ENTER)) { if (event == EVT_KEY_BREAK(KEY_ENTER)) {
if (enabled) { if (enabled) {
onKeyPress();
onPress(); onPress();
} }
} }
@@ -51,6 +52,7 @@ void Button::onEvent(event_t event)
bool Button::onTouchEnd(coord_t x, coord_t y) bool Button::onTouchEnd(coord_t x, coord_t y)
{ {
if (enabled) { if (enabled) {
onKeyPress();
if (!(windowFlags & NO_FOCUS)) { if (!(windowFlags & NO_FOCUS)) {
setFocus(SET_FOCUS_DEFAULT); setFocus(SET_FOCUS_DEFAULT);
} }
+1
View File
@@ -46,6 +46,7 @@ class ModalWindow: public Window
bool onTouchEnd(coord_t x, coord_t y) override bool onTouchEnd(coord_t x, coord_t y) override
{ {
if (!Window::onTouchEnd(x, y) && closeAllowed) { if (!Window::onTouchEnd(x, y) && closeAllowed) {
onKeyPress();
deleteLater(); deleteLater();
} }
return true; return true;