Avoid using non-ASCII key codes in key up/down events in wxOSX
Generating such events could result in mishandling some key presses as special keys, e.g. the Turkish "ş" characters was mistakenly processed as F12 because F12 corresponds to its Unicode character code (U+015F). Avoid this by only setting wxKeyEvent::m_keyCode for printable characters (while still making the actual key available in m_uniChar). This makes wxOSX consistent with wxGTK and documented behaviour. Closes https://github.com/wxWidgets/wxWidgets/pull/2081
This commit is contained in:
parent
952e5f32cd
commit
80a3cd2db9
@ -518,7 +518,7 @@ void wxWidgetCocoaImpl::SetupKeyEvent(wxKeyEvent &wxevent , NSEvent * nsEvent, N
|
||||
}
|
||||
}
|
||||
|
||||
if ( !keyval )
|
||||
if ( !keyval && aunichar < 256 ) // only for ASCII characters
|
||||
{
|
||||
if ( wxevent.GetEventType() == wxEVT_KEY_UP || wxevent.GetEventType() == wxEVT_KEY_DOWN )
|
||||
keyval = wxToupper( aunichar ) ;
|
||||
|
Loading…
Reference in New Issue
Block a user