Audacity  3.0.3
Namespaces | Typedefs | Functions
KeyboardCapture.h File Reference
#include <functional>
#include <wx/event.h>
Include dependency graph for KeyboardCapture.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 KeyboardCapture
 

Typedefs

using KeyboardCapture::FilterFunction = std::function< bool(wxKeyEvent &) >
 

Functions

 DECLARE_EXPORTED_EVENT_TYPE (AUDACITY_DLL_API, EVT_CAPTURE_KEY, -1)
 Custom events. More...
 
bool KeyboardCapture::IsHandler (const wxWindow *handler)
 
wxWindow * KeyboardCapture::GetHandler ()
 
void KeyboardCapture::Capture (wxWindow *handler)
 
void KeyboardCapture::Release (wxWindow *handler)
 
FilterFunction KeyboardCapture::SetPreFilter (const FilterFunction &function)
 Install a pre-filter, returning the previously installed one Pre-filter is called before passing the event to the captured window; if it returns false, then skip the event entirely. More...
 
FilterFunction KeyboardCapture::SetPostFilter (const FilterFunction &function)
 Install a post-filter, returning the previously installed one Post-filter is called if the captured window skips either the EVT_CAPTURE_KEY or the following wxKEY_DOWN event (but not if it skips only the wxEVT_CHAR or wxEVT_KEY_UP event); it is passed a wxKEY_DOWN or a wxKEY_UP event; if it returns false, then the event is skipped. More...
 
void KeyboardCapture::OnFocus (wxWindow &window, wxFocusEvent &event)
 a function useful to implement a focus event handler The window releases the keyboard if the event is for killing focus, otherwise the window captures the keyboard; then refresh the window and skip the event More...
 

Function Documentation

◆ DECLARE_EXPORTED_EVENT_TYPE()

DECLARE_EXPORTED_EVENT_TYPE ( AUDACITY_DLL_API  ,
EVT_CAPTURE_KEY  ,
1 
)

Custom events.

Type of event that may be sent to a window while it is installed as the handler with KeyboardCapture::Capture; if it does not skip the event, it will receive further events of type wxEVT_KEY_DOWN, and then wxEVT_CHAR (if key-down was not skipped; those further events don't actually come from wxWidgets, but are simulated by Audacity, as translations of the EVT_CHAR_HOOK event); or, wxEVT_KEY_UP (really from wxWidgets).