diff --git a/sdrgui/gui/valuedialz.cpp b/sdrgui/gui/valuedialz.cpp index 948bfe611..af29cd99a 100644 --- a/sdrgui/gui/valuedialz.cpp +++ b/sdrgui/gui/valuedialz.cpp @@ -474,6 +474,17 @@ void ValueDialZ::leaveEvent(QEvent*) } } +void ValueDialZ::inputMethodEvent(QInputMethodEvent* event) +{ + // Android numeric virtual keyboard sends inputMethodEvents rather than keyPressEvent for . and -. + // No + on keyboard, so use either to flip sign + if ((event->commitString() == ".") || (event->commitString() == "-")) + { + setValue(-m_value); + update(); + } +} + void ValueDialZ::keyPressEvent(QKeyEvent* value) { if(m_cursor >= 0) diff --git a/sdrgui/gui/valuedialz.h b/sdrgui/gui/valuedialz.h index ad3ca6135..aa76fcb8b 100644 --- a/sdrgui/gui/valuedialz.h +++ b/sdrgui/gui/valuedialz.h @@ -83,6 +83,7 @@ private: void wheelEvent(QWheelEvent*); void leaveEvent(QEvent*); void keyPressEvent(QKeyEvent*); + void inputMethodEvent(QInputMethodEvent*); void focusInEvent(QFocusEvent*); void focusOutEvent(QFocusEvent*);