Show details of key events in the control in dataview sample
This is just to make it more obvious that we get these events. See #15377.
This commit is contained in:
parent
f2da7beb36
commit
ffbcbd78b1
1 changed files with 13 additions and 0 deletions
|
|
@ -1767,6 +1767,19 @@ void MyFrame::OnSorted( wxDataViewEvent &event )
|
|||
|
||||
void MyFrame::OnDataViewChar(wxKeyEvent& event)
|
||||
{
|
||||
wxString key;
|
||||
#if wxUSE_UNICODE
|
||||
if ( event.GetUnicodeKey() != WXK_NONE )
|
||||
key.Printf("\"%c\"", event.GetUnicodeKey());
|
||||
else
|
||||
#endif
|
||||
if ( event.GetKeyCode() != WXK_NONE )
|
||||
key.Printf("wxKeyCode(%d)", event.GetKeyCode());
|
||||
else
|
||||
key = "unknown key";
|
||||
|
||||
wxLogMessage("wxEVT_CHAR for %s", key);
|
||||
|
||||
if ( event.GetKeyCode() == WXK_DELETE )
|
||||
DeleteSelectedItems();
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue