Add wxKeyEvent::IsAutoRepeat()

The new method is currently supported in Qt, Cocoa, MSW ports (i.e. all
major ones except for wxGTK).

Keyboard example updated with a "Repeat" column.

Closes https://github.com/wxWidgets/wxWidgets/pull/2414
This commit is contained in:
Marc Jessome
2021-07-03 19:03:03 -04:00
committed by Vadim Zeitlin
parent a37629b035
commit a052557af3
6 changed files with 23 additions and 1 deletions

View File

@@ -235,7 +235,7 @@ MyFrame::MyFrame(const wxString& title)
wxTE_READONLY);
headerText->SetValue(
" event key KeyCode mod UnicodeKey "
" RawKeyCode RawKeyFlags Position");
" RawKeyCode RawKeyFlags Position Repeat");
m_logText = new wxTextCtrl(this, wxID_ANY, "",
@@ -538,6 +538,7 @@ void MyFrame::LogEvent(const wxString& name, wxKeyEvent& event)
" not-set not-set"
#endif
" (%5d,%5d)"
" %s"
"\n",
name,
GetKeyName(event),
@@ -556,6 +557,7 @@ void MyFrame::LogEvent(const wxString& name, wxKeyEvent& event)
#endif
, event.GetX()
, event.GetY()
, event.IsAutoRepeat() ? "Yes" : "No"
);
m_logText->AppendText(msg);