MCPcopy Create free account
hub / github.com/audacity/audacity / OnHotkeyKeyDown

Method OnHotkeyKeyDown

src/prefs/KeyConfigPrefs.cpp:630–650  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

628}
629
630void KeyConfigPrefs::OnHotkeyKeyDown(wxKeyEvent & e)
631{
632 wxTextCtrl *t = (wxTextCtrl *)e.GetEventObject();
633
634 // Make sure we can navigate away from the hotkey textctrl.
635 // On Linux and OSX, it can get stuck, but it doesn't hurt
636 // to do it for Windows as well.
637 //
638 // Mac note: Don't waste time trying to figure out why the
639 // focus goes back to the prefs tree. Unless Voiceover is
640 // active, buttons on the Mac do not accept focus and all the
641 // controls between this one and the tree control are buttons.
642 if (e.GetKeyCode() == WXK_TAB) {
643 t->Navigate(e.ShiftDown()
644 ? wxNavigationKeyEvent::IsBackward
645 : wxNavigationKeyEvent::IsForward);
646 return;
647 }
648
649 t->SetValue(KeyEventToKeyString(e).Display());
650}
651
652void KeyConfigPrefs::OnHotkeyChar(wxEvent & WXUNUSED(e))
653{

Callers

nothing calls this directly

Calls 4

KeyEventToKeyStringFunction · 0.85
DisplayMethod · 0.80
NavigateMethod · 0.45
SetValueMethod · 0.45

Tested by

no test coverage detected