diff --git a/radio/src/thirdparty/libopenui/src/button.cpp b/radio/src/thirdparty/libopenui/src/button.cpp index 150381057..cf3e213b7 100644 --- a/radio/src/thirdparty/libopenui/src/button.cpp +++ b/radio/src/thirdparty/libopenui/src/button.cpp @@ -36,7 +36,8 @@ void Button::onEvent(event_t event) { TRACE_WINDOWS("%s received event 0x%X", getWindowDebugString("Button").c_str(), event); - if (enabled && event == EVT_KEY_BREAK(KEY_ENTER)) { + if (enabled && event == EVT_KEY_FIRST(KEY_ENTER)) { + killEvents(event); onKeyPress(); onPress(); } diff --git a/radio/src/thirdparty/libopenui/src/button.h b/radio/src/thirdparty/libopenui/src/button.h index 78ce23de7..a60ab6476 100644 --- a/radio/src/thirdparty/libopenui/src/button.h +++ b/radio/src/thirdparty/libopenui/src/button.h @@ -28,9 +28,11 @@ constexpr WindowFlags BUTTON_CHECKED_ON_FOCUS = FORM_FLAGS_LAST << 3u; class Button: public FormField { public: - Button(FormGroup * parent, const rect_t & rect, std::function pressHandler = nullptr, WindowFlags windowFlags = 0, LcdFlags textFlags = 0): - FormField(parent, rect, windowFlags, textFlags), - pressHandler(std::move(pressHandler)) + Button(FormGroup* parent, const rect_t& rect, + std::function pressHandler = nullptr, + WindowFlags windowFlags = 0, LcdFlags textFlags = 0) : + FormField(parent, rect, windowFlags, textFlags), + pressHandler(std::move(pressHandler)) { }