Ignore keys with modifiers in wxNumValidatorBase

This allows to use accelerators, such as Alt-X, when the focus is on a
key control using numeric validator in wxGTK.

(cherry picked from commit 39045e1ce5)
This commit is contained in:
Vadim Zeitlin
2023-07-03 02:45:38 +02:00
parent 49cb0550dc
commit bd57aac643
+7
View File
@@ -173,6 +173,13 @@ void wxNumValidatorBase::OnChar(wxKeyEvent& event)
return;
}
if ( event.GetModifiers() & ~wxMOD_SHIFT )
{
// Keys using modifiers other than Shift don't change the number, so
// ignore them.
return;
}
// Check if this character is allowed in the current state.
wxString val;
int pos;