Audacity  3.2.0
Public Member Functions | List of all members
InstallHandlers Struct Reference

Public Member Functions

 InstallHandlers ()
 

Detailed Description

Definition at line 1715 of file CommandManager.cpp.

Constructor & Destructor Documentation

◆ InstallHandlers()

InstallHandlers::InstallHandlers ( )
inline

Definition at line 1717 of file CommandManager.cpp.

1718  {
1719  KeyboardCapture::SetPreFilter( []( wxKeyEvent & ) {
1720  // We must have a project since we will be working with the
1721  // CommandManager, which is tied to individual projects.
1722  auto project = GetActiveProject().lock();
1723  return project && GetProjectFrame( *project ).IsEnabled();
1724  } );
1725  KeyboardCapture::SetPostFilter( []( wxKeyEvent &key ) {
1726  // Capture handler window didn't want it, so ask the CommandManager.
1727  if (auto project = GetActiveProject().lock()) {
1728  auto &manager = CommandManager::Get( *project );
1729  return manager.FilterKeyEvent(project.get(), key);
1730  }
1731  else
1732  return false;
1733  } );
1734  }

References CommandManager::Get(), GetActiveProject(), GetProjectFrame(), key, manager, KeyboardCapture::SetPostFilter(), and KeyboardCapture::SetPreFilter().

Here is the call graph for this function:

The documentation for this struct was generated from the following file:
KeyboardCapture::SetPostFilter
FilterFunction SetPostFilter(const FilterFunction &function)
Install a post-filter, returning the previously installed one Post-filter is called if the captured w...
Definition: KeyboardCapture.cpp:88
GetActiveProject
AUDACITY_DLL_API std::weak_ptr< AudacityProject > GetActiveProject()
Definition: ActiveProject.cpp:24
KeyboardCapture::SetPreFilter
FilterFunction SetPreFilter(const FilterFunction &function)
Install a pre-filter, returning the previously installed one Pre-filter is called before passing the ...
Definition: KeyboardCapture.cpp:81
key
static const AudacityProject::AttachedObjects::RegisteredFactory key
Definition: CommandManager.cpp:201
manager
static const AttachedProjectObjects::RegisteredFactory manager
Definition: RealtimeEffectManager.cpp:23
GetProjectFrame
AUDACITY_DLL_API wxFrame & GetProjectFrame(AudacityProject &project)
Get the top-level window associated with the project (as a wxFrame only, when you do not need to use ...
Definition: ProjectWindows.cpp:72
CommandManager::Get
static CommandManager & Get(AudacityProject &project)
Definition: CommandManager.cpp:207