diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2009-11-17 13:54:04 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2009-11-17 13:54:04 +0000 |
commit | 29d677e6681b02d6940346ac88a432558b6c2a43 (patch) | |
tree | 9db8a282b8f139e90518d31e89ef1ca0f3548114 /gtk2_ardour/actions.cc | |
parent | d0cc6edadfd793b5207a63226402eedc15f101b4 (diff) |
allow use of Return, KP_Enter and more in key binding editor; better display of such bindings; potential fix for "crashes" caused by an endless loop of enter/hide events involving the verbose canvas cursor
git-svn-id: svn://localhost/ardour2/branches/3.0@6109 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/actions.cc')
-rw-r--r-- | gtk2_ardour/actions.cc | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/gtk2_ardour/actions.cc b/gtk2_ardour/actions.cc index b446ee8569..1d70725163 100644 --- a/gtk2_ardour/actions.cc +++ b/gtk2_ardour/actions.cc @@ -36,6 +36,7 @@ #include "ardour/filesystem_paths.h" #include "ardour/rc_configuration.h" +#include "utils.h" #include "actions.h" #include "i18n.h" @@ -248,14 +249,7 @@ ActionManager::get_all_actions (vector<string>& names, vector<string>& paths, ve paths.push_back (accel_path); AccelKey key; - bool known = lookup_entry (accel_path, key); - - if (known) { - keys.push_back (ui_manager->get_accel_group()->name (key.get_key(), Gdk::ModifierType (key.get_mod()))); - } else { - keys.push_back (unbound_string); - } - + keys.push_back (get_key_representation (accel_path, key)); bindings.push_back (AccelKey (key.get_key(), Gdk::ModifierType (key.get_mod()))); } } @@ -442,3 +436,17 @@ ActionManager::map_some_state (const char* group, const char* action, sigc::slot } } } + +string +ActionManager::get_key_representation (const string& accel_path, AccelKey& key) +{ + bool known = lookup_entry (accel_path, key); + + if (known) { + uint32_t k = possibly_translate_legal_accelerator_to_real_key (key.get_key()); + key = AccelKey (k, Gdk::ModifierType (key.get_mod())); + return ui_manager->get_accel_group()->name (key.get_key(), Gdk::ModifierType (key.get_mod())); + } + + return unbound_string; +} |