1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-25 17:28:50 -05:00

Allow Android virtual keyboard to change sign in ValueDialZ widget

This commit is contained in:
Jon Beniston 2022-12-20 09:55:22 +00:00
parent c8af6e755e
commit e5c887646a
2 changed files with 12 additions and 0 deletions

View File

@ -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)

View File

@ -83,6 +83,7 @@ private:
void wheelEvent(QWheelEvent*);
void leaveEvent(QEvent*);
void keyPressEvent(QKeyEvent*);
void inputMethodEvent(QInputMethodEvent*);
void focusInEvent(QFocusEvent*);
void focusOutEvent(QFocusEvent*);