add API to query name of bound action
[ardour.git] / libs / gtkmm2ext / bindings.cc
index 2b1762da9088eba86aec456ee9a72299d2e4c2d8..0b03eeef152614f39dead0b38b32714f8c9df6a5 100644 (file)
@@ -1047,6 +1047,17 @@ Bindings::is_bound (KeyboardKey const& kb, Operation op) const
        return km.find(kb) != km.end();
 }
 
+std::string
+Bindings::bound_name (KeyboardKey const& kb, Operation op) const
+{
+       const KeybindingMap& km = get_keymap(op);
+       KeybindingMap::const_iterator b = km.find(kb);
+       if (b == km.end()) {
+               return "";
+       }
+       return b->second.action_name;
+}
+
 bool
 Bindings::is_registered (Operation op, std::string const& action_name) const
 {