Don't generate wxEVT_CHAR event for some special keys under wxQt
For compatibility with wxWidgets, don't generate wxEVT_CHAR event for the following keys: SHIFT, CONTROL, MENU, CAPITAL, NUMLOCK and SCROLL.
This commit is contained in:
parent
7fb1f03f2b
commit
e16a2cdbeb
1 changed files with 16 additions and 0 deletions
|
|
@ -1517,6 +1517,22 @@ bool wxWindowQt::QtHandleKeyEvent ( QWidget *WXUNUSED( handler ), QKeyEvent *eve
|
|||
}
|
||||
#endif // wxUSE_ACCEL
|
||||
|
||||
// For compatibility with wxMSW, don't generate wxEVT_CHAR event for
|
||||
// the following keys: SHIFT, CONTROL, MENU, CAPITAL, NUMLOCK and SCROLL.
|
||||
switch ( event->key() )
|
||||
{
|
||||
case Qt::Key_Shift:
|
||||
case Qt::Key_Control:
|
||||
case Qt::Key_Meta:
|
||||
case Qt::Key_Alt:
|
||||
case Qt::Key_AltGr:
|
||||
case Qt::Key_CapsLock:
|
||||
case Qt::Key_NumLock:
|
||||
case Qt::Key_ScrollLock:
|
||||
// Skip event generation.
|
||||
return handled;
|
||||
}
|
||||
|
||||
e.SetEventType( wxEVT_CHAR );
|
||||
e.SetEventObject(this);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue