Audacity 3.2.0
KeyboardCapture.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 KeyboardCapture.h
6
7 Paul Licameli split this from Project.h
8
9**********************************************************************/
10
11#ifndef __AUDACITY_KEYBOARD_CAPTURE__
12#define __AUDACITY_KEYBOARD_CAPTURE__
13
14
15
16#include <functional>
17#include <wx/event.h>
18
19#include "GlobalVariable.h"
20
24
32DECLARE_EXPORTED_EVENT_TYPE(AUDACITY_DLL_API, EVT_CAPTURE_KEY, -1);
33
34namespace KeyboardCapture
35{
36 AUDACITY_DLL_API bool IsHandler(const wxWindow *handler);
37 AUDACITY_DLL_API wxWindow *GetHandler();
38 AUDACITY_DLL_API void Capture(wxWindow *handler);
39 AUDACITY_DLL_API void Release(wxWindow *handler);
40
42
43 struct AUDACITY_DLL_API PreFilter : GlobalHook<PreFilter,
44 bool( wxKeyEvent& )
45 >{};
46
48
55 struct AUDACITY_DLL_API PostFilter : GlobalHook<PostFilter,
56 bool( wxKeyEvent& )
57 >{};
58
63 AUDACITY_DLL_API
64 void OnFocus( wxWindow &window, wxFocusEvent &event );
65}
66
67#endif
DECLARE_EXPORTED_EVENT_TYPE(AUDACITY_DLL_API, EVT_CAPTURE_KEY, -1)
Custom events.
Global function-valued variable, adding a convenient Call()
bool IsHandler(const wxWindow *handler)
wxWindow * GetHandler()
void Release(wxWindow *handler)
void OnFocus(wxWindow &window, wxFocusEvent &event)
a function useful to implement a focus event handler The window releases the keyboard if the event is...
void Capture(wxWindow *handler)
Post-filter is conditionally called after passing the event to the window.
Pre-filter is called before passing the event to the captured window.