1 #ifndef _BC_KEYBOARD_H_
2 #define _BC_KEYBOARD_H_
4 #include "bcwindowbase.inc"
5 #include "bcsignals.inc"
8 // global listeners for remote control
10 class BC_KeyboardHandler {
11 int(BC_WindowBase::*handler)(BC_WindowBase *win);
13 static ArrayList<BC_KeyboardHandler*> listeners;
14 friend class BC_WindowBase;
15 friend class BC_Signals;
17 BC_KeyboardHandler(int(BC_WindowBase::*h)(BC_WindowBase *), BC_WindowBase *d)
18 : handler(h), win(d) {}
19 ~BC_KeyboardHandler() {}
20 static int run_listeners(BC_WindowBase *wp);
21 int run_event(BC_WindowBase *wp);
22 static void kill_grabs();
25 class BC_KeyboardHandlerLock {
26 static Mutex keyboard_listener_mutex;
28 BC_KeyboardHandlerLock() { keyboard_listener_mutex.lock(); }
29 ~BC_KeyboardHandlerLock() { keyboard_listener_mutex.unlock(); }