2 Copyright (C) 2001 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29 #include <glib/gstdio.h>
31 #include <gtkmm/widget.h>
32 #include <gtkmm/window.h>
33 #include <gtkmm/accelmap.h>
34 #include <gdk/gdkkeysyms.h>
36 #include "pbd/error.h"
37 #include "pbd/convert.h"
38 #include "pbd/file_utils.h"
39 #include "pbd/search_path.h"
40 #include "pbd/xml++.h"
41 #include "pbd/debug.h"
42 #include "pbd/unwind.h"
44 #include "gtkmm2ext/keyboard.h"
45 #include "gtkmm2ext/actions.h"
46 #include "gtkmm2ext/debug.h"
52 using namespace Gtkmm2ext;
55 guint Keyboard::edit_but = 3;
56 guint Keyboard::edit_mod = GDK_CONTROL_MASK;
57 guint Keyboard::delete_but = 3;
58 guint Keyboard::delete_mod = GDK_SHIFT_MASK;
59 guint Keyboard::insert_note_but = 1;
60 guint Keyboard::insert_note_mod = GDK_CONTROL_MASK;
61 guint Keyboard::snap_mod = GDK_MOD3_MASK;
62 guint Keyboard::snap_delta_mod = 0;
66 uint Keyboard::PrimaryModifier = GDK_MOD2_MASK; // Command
67 guint Keyboard::SecondaryModifier = GDK_CONTROL_MASK; // Control
68 guint Keyboard::TertiaryModifier = GDK_SHIFT_MASK; // Shift
69 guint Keyboard::Level4Modifier = GDK_MOD1_MASK; // Alt/Option
70 guint Keyboard::CopyModifier = GDK_CONTROL_MASK; // Control
71 guint Keyboard::RangeSelectModifier = GDK_SHIFT_MASK;
72 guint Keyboard::button2_modifiers = Keyboard::SecondaryModifier|Keyboard::Level4Modifier;
74 const char* Keyboard::primary_modifier_name() { return _("Command"); }
75 const char* Keyboard::secondary_modifier_name() { return _("Control"); }
76 const char* Keyboard::tertiary_modifier_name() { return S_("Key|Shift"); }
77 const char* Keyboard::level4_modifier_name() { return _("Option"); }
78 const char* Keyboard::copy_modifier_name() { return _("Control"); }
79 const char* Keyboard::rangeselect_modifier_name() { return S_("Key|Shift"); }
83 guint Keyboard::PrimaryModifier = GDK_CONTROL_MASK; // Control
84 guint Keyboard::SecondaryModifier = GDK_MOD1_MASK; // Alt/Option
85 guint Keyboard::TertiaryModifier = GDK_SHIFT_MASK; // Shift
86 guint Keyboard::Level4Modifier = GDK_MOD4_MASK; // Mod4/Windows
87 guint Keyboard::CopyModifier = GDK_CONTROL_MASK;
88 guint Keyboard::RangeSelectModifier = GDK_SHIFT_MASK;
89 guint Keyboard::button2_modifiers = 0; /* not used */
91 const char* Keyboard::primary_modifier_name() { return _("Control"); }
92 const char* Keyboard::secondary_modifier_name() { return _("Alt"); }
93 const char* Keyboard::tertiary_modifier_name() { return S_("Key|Shift"); }
94 const char* Keyboard::level4_modifier_name() { return _("Meta"); }
95 const char* Keyboard::copy_modifier_name() { return _("Control"); }
96 const char* Keyboard::rangeselect_modifier_name() { return S_("Key|Shift"); }
100 guint Keyboard::GainFineScaleModifier = Keyboard::PrimaryModifier;
101 guint Keyboard::GainExtraFineScaleModifier = Keyboard::SecondaryModifier;
103 guint Keyboard::ScrollZoomVerticalModifier = Keyboard::SecondaryModifier;
104 guint Keyboard::ScrollZoomHorizontalModifier = Keyboard::PrimaryModifier;
105 guint Keyboard::ScrollHorizontalModifier = Keyboard::TertiaryModifier;
107 guint Keyboard::trim_contents_mod = Keyboard::PrimaryModifier;
108 guint Keyboard::trim_overlap_mod = Keyboard::TertiaryModifier;
109 guint Keyboard::trim_anchored_mod = Keyboard::TertiaryModifier;
110 guint Keyboard::trim_jump_mod = Keyboard::TertiaryModifier;
111 guint Keyboard::fine_adjust_mod = Keyboard::SecondaryModifier;
112 guint Keyboard::push_points_mod = Keyboard::PrimaryModifier;
113 guint Keyboard::note_size_relative_mod = Keyboard::PrimaryModifier;
115 Keyboard* Keyboard::_the_keyboard = 0;
116 Gtk::Window* Keyboard::current_window = 0;
117 bool Keyboard::_some_magic_widget_has_focus = false;
119 std::string Keyboard::user_keybindings_path;
120 bool Keyboard::can_save_keybindings = false;
121 bool Keyboard::bindings_changed_after_save_became_legal = false;
122 map<string,string> Keyboard::binding_files;
123 string Keyboard::_current_binding_name;
124 map<AccelKey,pair<string,string>,Keyboard::AccelKeyLess> Keyboard::release_keys;
126 /* set this to initially contain the modifiers we care about, then track changes in ::set_edit_modifier() etc. */
128 GdkModifierType Keyboard::RelevantModifierKeyMask;
131 Keyboard::magic_widget_grab_focus ()
133 _some_magic_widget_has_focus = true;
137 Keyboard::magic_widget_drop_focus ()
139 _some_magic_widget_has_focus = false;
143 Keyboard::some_magic_widget_has_focus ()
145 return _some_magic_widget_has_focus;
148 Keyboard::Keyboard ()
150 if (_the_keyboard == 0) {
151 _the_keyboard = this;
152 _current_binding_name = _("Unknown");
155 RelevantModifierKeyMask = (GdkModifierType) gtk_accelerator_get_default_mod_mask ();
157 RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask | PrimaryModifier);
158 RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask | SecondaryModifier);
159 RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask | TertiaryModifier);
160 RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask | Level4Modifier);
161 RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask | CopyModifier);
162 RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask | RangeSelectModifier);
164 gtk_accelerator_set_default_mod_mask (RelevantModifierKeyMask);
166 snooper_id = gtk_key_snooper_install (_snooper, (gpointer) this);
169 Keyboard::~Keyboard ()
171 gtk_key_snooper_remove (snooper_id);
175 Keyboard::get_state (void)
177 XMLNode* node = new XMLNode ("Keyboard");
180 snprintf (buf, sizeof (buf), "%d", edit_but);
181 node->add_property ("edit-button", buf);
182 snprintf (buf, sizeof (buf), "%d", edit_mod);
183 node->add_property ("edit-modifier", buf);
184 snprintf (buf, sizeof (buf), "%d", delete_but);
185 node->add_property ("delete-button", buf);
186 snprintf (buf, sizeof (buf), "%d", delete_mod);
187 node->add_property ("delete-modifier", buf);
188 snprintf (buf, sizeof (buf), "%d", snap_mod);
189 node->add_property ("snap-modifier", buf);
190 snprintf (buf, sizeof (buf), "%d", snap_delta_mod);
191 node->add_property ("snap-delta-modifier", buf);
192 snprintf (buf, sizeof (buf), "%d", trim_contents_mod);
193 node->add_property ("trim-contents-modifier", buf);
194 snprintf (buf, sizeof (buf), "%d", trim_overlap_mod);
195 node->add_property ("trim-overlap-modifier", buf);
196 snprintf (buf, sizeof (buf), "%d", trim_anchored_mod);
197 node->add_property ("trim-anchored-modifier", buf);
198 snprintf (buf, sizeof (buf), "%d", trim_jump_mod);
199 node->add_property ("trim-jump-modifier", buf);
200 snprintf (buf, sizeof (buf), "%d", fine_adjust_mod);
201 node->add_property ("fine-adjust-modifier", buf);
202 snprintf (buf, sizeof (buf), "%d", push_points_mod);
203 node->add_property ("push-points-modifier", buf);
204 snprintf (buf, sizeof (buf), "%d", note_size_relative_mod);
205 node->add_property ("note-size-relative-modifier", buf);
206 snprintf (buf, sizeof (buf), "%d", insert_note_but);
207 node->add_property ("insert-note-button", buf);
208 snprintf (buf, sizeof (buf), "%d", insert_note_mod);
209 node->add_property ("insert-note-modifier", buf);
215 Keyboard::set_state (const XMLNode& node, int /*version*/)
217 const XMLProperty* prop;
219 if ((prop = node.property ("edit-button")) != 0) {
220 sscanf (prop->value().c_str(), "%d", &edit_but);
223 if ((prop = node.property ("edit-modifier")) != 0) {
224 sscanf (prop->value().c_str(), "%d", &edit_mod);
227 if ((prop = node.property ("delete-button")) != 0) {
228 sscanf (prop->value().c_str(), "%d", &delete_but);
231 if ((prop = node.property ("delete-modifier")) != 0) {
232 sscanf (prop->value().c_str(), "%d", &delete_mod);
235 if ((prop = node.property ("snap-modifier")) != 0) {
236 sscanf (prop->value().c_str(), "%d", &snap_mod);
239 if ((prop = node.property ("snap-delta-modifier")) != 0) {
240 sscanf (prop->value().c_str(), "%d", &snap_delta_mod);
243 if ((prop = node.property ("trim-contents-modifier")) != 0) {
244 sscanf (prop->value().c_str(), "%d", &trim_contents_mod);
247 if ((prop = node.property ("trim-overlap-modifier")) != 0) {
248 sscanf (prop->value().c_str(), "%d", &trim_overlap_mod);
251 if ((prop = node.property ("trim-anchored-modifier")) != 0) {
252 sscanf (prop->value().c_str(), "%d", &trim_anchored_mod);
255 if ((prop = node.property ("trim-jump-modifier")) != 0) {
256 sscanf (prop->value().c_str(), "%d", &trim_jump_mod);
259 if ((prop = node.property ("fine-adjust-modifier")) != 0) {
260 sscanf (prop->value().c_str(), "%d", &fine_adjust_mod);
263 if ((prop = node.property ("push-points-modifier")) != 0) {
264 sscanf (prop->value().c_str(), "%d", &push_points_mod);
267 if ((prop = node.property ("note-size-relative-modifier")) != 0) {
268 sscanf (prop->value().c_str(), "%d", ¬e_size_relative_mod);
271 if ((prop = node.property ("insert-note-button")) != 0) {
272 sscanf (prop->value().c_str(), "%d", &insert_note_but);
275 if ((prop = node.property ("insert-note-modifier")) != 0) {
276 sscanf (prop->value().c_str(), "%d", &insert_note_mod);
283 Keyboard::_snooper (GtkWidget *widget, GdkEventKey *event, gpointer data)
285 return ((Keyboard *) data)->snooper (widget, event);
289 Keyboard::snooper (GtkWidget *widget, GdkEventKey *event)
297 "Snoop widget %1 name: [%6] key %2 type %3 state %4 magic %5\n",
298 widget, event->keyval, event->type, event->state, _some_magic_widget_has_focus,
299 gtk_widget_get_name (widget)
303 if (event->keyval == GDK_Shift_R) {
304 keyval = GDK_Shift_L;
306 } else if (event->keyval == GDK_Control_R) {
307 keyval = GDK_Control_L;
310 keyval = event->keyval;
313 if (event->state & ScrollZoomVerticalModifier) {
314 /* There is a special and rather hacky situation in Editor which makes
315 it useful to know when the modifier key for vertical zoom has been
316 released, so emit a signal here (see Editor::_stepping_axis_view).
317 Note that the state bit for the modifier key is set for the key-up
318 event when the modifier is released, but not the key-down when it
319 is pressed, so we get here on key-up, which is what we want.
321 ZoomVerticalModifierReleased (); /* EMIT SIGNAL */
324 if (event->type == GDK_KEY_PRESS) {
326 if (find (state.begin(), state.end(), keyval) == state.end()) {
327 state.push_back (keyval);
328 sort (state.begin(), state.end());
332 /* key is already down. if its also used for release,
333 prevent auto-repeat events.
336 for (map<AccelKey,two_strings,AccelKeyLess>::iterator k = release_keys.begin(); k != release_keys.end(); ++k) {
338 const AccelKey& ak (k->first);
340 if (keyval == ak.get_key() && (Gdk::ModifierType)((event->state & Keyboard::RelevantModifierKeyMask) | Gdk::RELEASE_MASK) == ak.get_mod()) {
341 DEBUG_TRACE (DEBUG::Keyboard, "Suppress auto repeat\n");
348 } else if (event->type == GDK_KEY_RELEASE) {
352 if ((i = find (state.begin(), state.end(), keyval)) != state.end()) {
354 sort (state.begin(), state.end());
357 for (map<AccelKey,two_strings,AccelKeyLess>::iterator k = release_keys.begin(); k != release_keys.end(); ++k) {
359 const AccelKey& ak (k->first);
360 two_strings ts (k->second);
362 if (keyval == ak.get_key() && (Gdk::ModifierType)((event->state & Keyboard::RelevantModifierKeyMask) | Gdk::RELEASE_MASK) == ak.get_mod()) {
363 Glib::RefPtr<Gtk::Action> act = ActionManager::get_action (ts.first.c_str(), ts.second.c_str());
365 DEBUG_TRACE (DEBUG::Keyboard, string_compose ("Activate %1 %2\n", ts.first, ts.second));
367 DEBUG_TRACE (DEBUG::Keyboard, string_compose ("Use repeat, suppress other\n", ts.first, ts.second));
375 /* Special keys that we want to handle in
376 any dialog, no matter whether it uses
377 the regular set of accelerators or not
380 if (event->type == GDK_KEY_RELEASE && modifier_state_equals (event->state, PrimaryModifier)) {
381 switch (event->keyval) {
383 close_current_dialog ();
389 DEBUG_TRACE (DEBUG::Keyboard, string_compose ("snooper returns %1\n", ret));
395 Keyboard::close_current_dialog ()
397 if (current_window) {
398 current_window->hide ();
404 Keyboard::key_is_down (uint32_t keyval)
406 return find (state.begin(), state.end(), keyval) != state.end();
410 Keyboard::enter_window (GdkEventCrossing *, Gtk::Window* win)
412 current_window = win;
413 DEBUG_TRACE (DEBUG::Keyboard, string_compose ("Entering window, title = %1\n", win->get_title()));
418 Keyboard::leave_window (GdkEventCrossing *ev, Gtk::Window* /*win*/)
421 switch (ev->detail) {
422 case GDK_NOTIFY_INFERIOR:
423 DEBUG_TRACE (DEBUG::Keyboard, "INFERIOR crossing ... out\n");
426 case GDK_NOTIFY_VIRTUAL:
427 DEBUG_TRACE (DEBUG::Keyboard, "VIRTUAL crossing ... out\n");
431 DEBUG_TRACE (DEBUG::Keyboard, "REAL crossing ... out\n");
432 DEBUG_TRACE (DEBUG::Keyboard, "Clearing current target\n");
444 Keyboard::focus_in_window (GdkEventFocus *, Gtk::Window* win)
446 current_window = win;
447 DEBUG_TRACE (DEBUG::Keyboard, string_compose ("Focusing in window, title = %1\n", win->get_title()));
452 Keyboard::focus_out_window (GdkEventFocus * ev, Gtk::Window* win)
461 DEBUG_TRACE (DEBUG::Keyboard, string_compose ("Foucusing out window, title = %1\n", win->get_title()));
467 Keyboard::set_edit_button (guint but)
473 Keyboard::set_edit_modifier (guint mod)
475 RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask & ~edit_mod);
477 RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask | edit_mod);
481 Keyboard::set_delete_button (guint but)
487 Keyboard::set_delete_modifier (guint mod)
489 RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask & ~delete_mod);
491 RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask | delete_mod);
495 Keyboard::set_insert_note_button (guint but)
497 insert_note_but = but;
501 Keyboard::set_insert_note_modifier (guint mod)
503 RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask & ~insert_note_mod);
504 insert_note_mod = mod;
505 RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask | insert_note_mod);
510 Keyboard::set_modifier (uint32_t newval, uint32_t& var)
512 RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask & ~var);
514 RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask | var);
518 Keyboard::set_snap_modifier (guint mod)
520 RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask & ~snap_mod);
522 RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask | snap_mod);
526 Keyboard::set_snap_delta_modifier (guint mod)
528 RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask & ~snap_delta_mod);
529 snap_delta_mod = mod;
530 RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask | snap_delta_mod);
534 Keyboard::set_trim_contents_modifier (guint mod)
536 RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask & ~trim_contents_mod);
537 trim_contents_mod = mod;
538 RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask | trim_contents_mod);
542 Keyboard::set_trim_overlap_modifier (guint mod)
544 RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask & ~trim_overlap_mod);
545 trim_overlap_mod = mod;
546 RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask | trim_overlap_mod);
550 Keyboard::set_trim_anchored_modifier (guint mod)
552 RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask & ~trim_anchored_mod);
553 trim_anchored_mod = mod;
554 RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask | trim_anchored_mod);
558 Keyboard::set_trim_jump_modifier (guint mod)
560 RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask & ~trim_jump_mod);
562 RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask | trim_jump_mod);
566 Keyboard::set_fine_adjust_modifier (guint mod)
568 RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask & ~fine_adjust_mod);
569 fine_adjust_mod = mod;
570 RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask | fine_adjust_mod);
574 Keyboard::set_push_points_modifier (guint mod)
576 RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask & ~push_points_mod);
577 push_points_mod = mod;
578 RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask | push_points_mod);
582 Keyboard::set_note_size_relative_modifier (guint mod)
584 RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask & ~note_size_relative_mod);
585 note_size_relative_mod = mod;
586 RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask | note_size_relative_mod);
590 Keyboard::is_edit_event (GdkEventButton *ev)
592 return (ev->type == GDK_BUTTON_PRESS || ev->type == GDK_BUTTON_RELEASE) &&
593 (ev->button == Keyboard::edit_button()) &&
594 ((ev->state & RelevantModifierKeyMask) == Keyboard::edit_modifier());
598 Keyboard::is_insert_note_event (GdkEventButton *ev)
600 return (ev->type == GDK_BUTTON_PRESS || ev->type == GDK_BUTTON_RELEASE) &&
601 (ev->button == Keyboard::insert_note_button()) &&
602 ((ev->state & RelevantModifierKeyMask) == Keyboard::insert_note_modifier());
606 Keyboard::is_button2_event (GdkEventButton* ev)
609 return (ev->button == 2) ||
610 ((ev->button == 1) &&
611 ((ev->state & Keyboard::button2_modifiers) == Keyboard::button2_modifiers));
613 return ev->button == 2;
618 Keyboard::is_delete_event (GdkEventButton *ev)
620 return (ev->type == GDK_BUTTON_PRESS || ev->type == GDK_BUTTON_RELEASE) &&
621 (ev->button == Keyboard::delete_button()) &&
622 ((ev->state & RelevantModifierKeyMask) == Keyboard::delete_modifier());
626 Keyboard::is_context_menu_event (GdkEventButton *ev)
628 return (ev->type == GDK_BUTTON_PRESS || ev->type == GDK_BUTTON_RELEASE) &&
630 ((ev->state & RelevantModifierKeyMask) == 0);
634 Keyboard::no_modifiers_active (guint state)
636 return (state & RelevantModifierKeyMask) == 0;
640 Keyboard::modifier_state_contains (guint state, ModifierMask mask)
642 return (state & mask) == (guint) mask;
646 Keyboard::modifier_state_equals (guint state, ModifierMask mask)
648 return (state & RelevantModifierKeyMask) == (guint) mask;
652 Keyboard::keybindings_changed ()
654 if (Keyboard::can_save_keybindings) {
655 Keyboard::bindings_changed_after_save_became_legal = true;
658 Keyboard::save_keybindings ();
662 Keyboard::set_can_save_keybindings (bool yn)
664 can_save_keybindings = yn;
668 Keyboard::save_keybindings ()
670 if (can_save_keybindings && bindings_changed_after_save_became_legal) {
671 Gtk::AccelMap::save (user_keybindings_path);
676 Keyboard::load_keybindings (string path)
679 info << "Loading bindings from " << path << endl;
681 Gtk::AccelMap::load (path);
683 _current_binding_name = _("Unknown");
685 for (map<string,string>::iterator x = binding_files.begin(); x != binding_files.end(); ++x) {
686 if (path == x->second) {
687 _current_binding_name = x->first;
694 error << string_compose (_("key bindings file not found at \"%2\" or contains errors."), path)
699 /* now find all release-driven bindings */
701 vector<string> groups;
702 vector<string> names;
703 vector<string> tooltips;
704 vector<AccelKey> bindings;
706 ActionManager::get_all_actions (groups, names, tooltips, bindings);
708 vector<string>::iterator g;
709 vector<AccelKey>::iterator b;
710 vector<string>::iterator n;
712 release_keys.clear ();
714 for (n = names.begin(), b = bindings.begin(), g = groups.begin(); n != names.end(); ++n, ++b, ++g) {
716 s << "Action: " << *n << " Group: " << *g << " Binding: ";
718 if ((*b).get_key() != GDK_VoidSymbol) {
719 s << b->get_key() << " w/mod " << hex << b->get_mod() << dec << " = " << b->get_abbrev () << "\n";
724 DEBUG_TRACE (DEBUG::Bindings, s.str ());
727 for (n = names.begin(), b = bindings.begin(), g = groups.begin(); n != names.end(); ++n, ++b, ++g) {
728 if ((*b).get_mod() & Gdk::RELEASE_MASK) {
729 release_keys.insert (pair<AccelKey,two_strings> (*b, two_strings (*g, *n)));
737 Keyboard::reset_bindings ()
739 if (Glib::file_test (user_keybindings_path, Glib::FILE_TEST_EXISTS)) {
741 string new_path = user_keybindings_path;
744 if (::g_rename (user_keybindings_path.c_str(), new_path.c_str())) {
745 error << string_compose (_("Cannot rename your own keybinding file (%1)"), strerror (errno)) << endmsg;
751 PBD::Unwinder<bool> uw (can_save_keybindings, false);
752 setup_keybindings ();