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 39045e1ce5a3f9c724fcdbb84d5377f5ba9c3a28)
This commit is contained in:
Vadim Zeitlin 2023-07-02 22:43:15 +02:00
parent 49cb0550dc
commit bd57aac643

View File

@ -173,6 +173,13 @@ void wxNumValidatorBase::OnChar(wxKeyEvent& event)
return; 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. // Check if this character is allowed in the current state.
wxString val; wxString val;
int pos; int pos;