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

Method OnFilterKeyDown

src/prefs/KeyConfigPrefs.cpp:681–721  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

679}
680
681void KeyConfigPrefs::OnFilterKeyDown(wxKeyEvent & e)
682{
683 wxTextCtrl *t = (wxTextCtrl *)e.GetEventObject();
684 int keycode = e.GetKeyCode();
685
686 // Make sure we can navigate away from the hotkey textctrl.
687 // On Linux and OSX, it an get stuck, but it doesn't hurt
688 // to do it for Windows as well.
689 if (keycode == WXK_TAB) {
690 wxNavigationKeyEvent nevent;
691 nevent.SetWindowChange(e.ControlDown());
692 nevent.SetDirection(!e.ShiftDown());
693 nevent.SetEventObject(t);
694 nevent.SetCurrentFocus(t);
695 t->GetParent()->GetEventHandler()->ProcessEvent(nevent);
696
697 return;
698 }
699
700 if (mViewType == ViewByKey) {
701 wxString key = KeyEventToKeyString(e).Display();
702 t->SetValue(key);
703
704 if (!key.empty()) {
705 mView->SetFilter(t->GetValue());
706 }
707 }
708 else
709 {
710 if (keycode == WXK_RETURN) {
711 mFilterPending = false;
712 mView->SetFilter(t->GetValue());
713 }
714 else {
715 mFilterPending = true;
716 mFilterTimer.Start(500, wxTIMER_ONE_SHOT);
717
718 e.Skip();
719 }
720 }
721}
722
723void KeyConfigPrefs::OnFilterChar(wxEvent & e)
724{

Callers

nothing calls this directly

Calls 10

KeyEventToKeyStringFunction · 0.85
ProcessEventMethod · 0.80
DisplayMethod · 0.80
SetFilterMethod · 0.80
SkipMethod · 0.80
GetParentMethod · 0.45
SetValueMethod · 0.45
emptyMethod · 0.45
GetValueMethod · 0.45
StartMethod · 0.45

Tested by

no test coverage detected