Merge branch 'qt-event-trans' of https://github.com/AliKet/wxWidgets
Some fixes for keyboard event processing in wxQt. See #23974.
This commit is contained in:
commit
93b8819a03
2 changed files with 22 additions and 2 deletions
|
|
@ -196,6 +196,8 @@ wxKeyCode wxQtConvertKeyCode( int key, Qt::KeyboardModifiers modifiers )
|
|||
return WXK_EXECUTE;
|
||||
case Qt::Key_Insert:
|
||||
return WXK_INSERT;
|
||||
case Qt::Key_Delete:
|
||||
return WXK_DELETE;
|
||||
case Qt::Key_Help:
|
||||
return WXK_HELP;
|
||||
case Qt::Key_NumLock:
|
||||
|
|
@ -309,8 +311,8 @@ int wxQtConvertKeyCode( int key, int WXUNUSED(modifiers), Qt::KeyboardModifiers
|
|||
return Qt::Key_Escape;
|
||||
case WXK_CANCEL:
|
||||
return Qt::Key_Cancel;
|
||||
case Qt::Key_Clear:
|
||||
return WXK_CLEAR;
|
||||
case WXK_CLEAR:
|
||||
return Qt::Key_Clear;
|
||||
case WXK_SHIFT:
|
||||
return Qt::Key_Shift;
|
||||
case WXK_ALT:
|
||||
|
|
@ -335,6 +337,8 @@ int wxQtConvertKeyCode( int key, int WXUNUSED(modifiers), Qt::KeyboardModifiers
|
|||
return Qt::Key_Execute;
|
||||
case WXK_INSERT:
|
||||
return Qt::Key_Insert;
|
||||
case WXK_DELETE:
|
||||
return Qt::Key_Delete;
|
||||
case WXK_HELP:
|
||||
return Qt::Key_Help;
|
||||
case WXK_NUMLOCK:
|
||||
|
|
|
|||
|
|
@ -1490,6 +1490,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