X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/697c314b162ff4758db0047e548d5401994d2c70..33f4afdbc08a2a8b8438420aa9d16aadee0bacc2:/src/generic/odcombo.cpp?ds=sidebyside diff --git a/src/generic/odcombo.cpp b/src/generic/odcombo.cpp index 618375b221..9759b33a33 100644 --- a/src/generic/odcombo.cpp +++ b/src/generic/odcombo.cpp @@ -257,14 +257,18 @@ bool wxVListBoxComboPopup::HandleKey( int keycode, bool saturate, wxChar unicode int comboStyle = m_combo->GetWindowStyle(); // this is the character equivalent of the code - wxChar keychar=0; - if ((keycode >= WXK_SPACE) && (keycode <=255) && (keycode != WXK_DELETE) && wxIsprint(keycode)) + wxChar keychar = 0; + if ( keycode < WXK_START ) { - keychar = (wxChar)keycode; - } - else if (unicode>0) - { - keychar = unicode; + if ( unicode > 0 ) + { + if ( wxIsprint(unicode) ) + keychar = unicode; + } + else if ( wxIsprint(keycode) ) + { + keychar = (wxChar) keycode; + } } if ( keycode == WXK_DOWN || keycode == WXK_RIGHT ) @@ -287,7 +291,7 @@ bool wxVListBoxComboPopup::HandleKey( int keycode, bool saturate, wxChar unicode value-=10; StopPartialCompletion(); } - else if ( comboStyle & wxCB_READONLY ) + else if ( keychar && (comboStyle & wxCB_READONLY) ) { // Try partial completion