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

Public Member Functions

 InstallHandlers ()
 

Detailed Description

Definition at line 1712 of file CommandManager.cpp.

Constructor & Destructor Documentation

◆ InstallHandlers()

InstallHandlers::InstallHandlers ( )
inline

Definition at line 1714 of file CommandManager.cpp.

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

References CommandManager::Get(), GetActiveProject(), GetProjectFrame(), key, 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
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