-void
-Keyboard::register_target (KeyboardTarget *kt)
-{
- /* do not register the default - its not meant to be
- an actual window, just a fallback if the current
- target for keyboard events doesn't handle an event.
- */
-
- if (kt->name() == X_("default")) {
- return;
- }
-
- kt->window().enter_notify_event.connect (bind (slot (*this, &Keyboard::enter_window), kt));
- kt->window().leave_notify_event.connect (slot (*this, &Keyboard::leave_window));
-
- kt->GoingAway.connect (bind (slot (*this, &Keyboard::maybe_unset_target), kt));
- kt->Hiding.connect (bind (slot (*this, &Keyboard::maybe_unset_target), kt));
-}
-
-void
-Keyboard::set_current_dialog (ArdourDialog* dialog)
-{
- ENSURE_GUI_THREAD(bind (slot (*this, &Keyboard::set_current_dialog), dialog));
-
- current_dialog = dialog;
-
- if (current_dialog) {
-
- if (find (known_dialogs.begin(), known_dialogs.end(), dialog) == known_dialogs.end()) {
-
- current_dialog->GoingAway.connect
- (bind (slot (*this, &Keyboard::set_current_dialog),
- reinterpret_cast<ArdourDialog *>(0)));
- current_dialog->Hiding.connect
- (bind (slot (*this, &Keyboard::set_current_dialog),
- reinterpret_cast<ArdourDialog *>(0)));
-
- current_dialog->unmap_event.connect (slot (*this, &Keyboard::current_dialog_vanished));
-
- known_dialogs.push_back (dialog);
- }
- }
-}
-
-gint
-Keyboard::current_dialog_vanished (GdkEventAny *ev)
-{
- current_dialog = 0;
- state.clear ();
- focus_allowed = false;
- clear_modifier_state ();
- current_prefix = "";
-
- return FALSE;
-}
-
-void
-Keyboard::close_current_dialog ()
-{
- if (current_dialog) {
- current_dialog->hide ();
- }
-}
-