diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2015-07-09 18:10:19 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-02-22 15:31:22 -0500 |
commit | 37fce09a18afe93460baefc15a700633a034d5e3 (patch) | |
tree | 89d5ffed65c28957fc5512b74be7e453f0052159 /libs/gtkmm2ext/bindings.cc | |
parent | 50e4ebff36108804d968bbe878ff4a470b1295f8 (diff) |
widespread changes to get the new (oldArdour binding scheme to be used for keyboard accelerators
Diffstat (limited to 'libs/gtkmm2ext/bindings.cc')
-rw-r--r-- | libs/gtkmm2ext/bindings.cc | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/libs/gtkmm2ext/bindings.cc b/libs/gtkmm2ext/bindings.cc index 5efb40eea2..8d77009347 100644 --- a/libs/gtkmm2ext/bindings.cc +++ b/libs/gtkmm2ext/bindings.cc @@ -227,6 +227,24 @@ Bindings::~Bindings() { } +bool +Bindings::empty_keys() const +{ + return press_bindings.empty() && release_bindings.empty(); +} + +bool +Bindings::empty_mouse () const +{ + return button_press_bindings.empty() && button_release_bindings.empty(); +} + +bool +Bindings::empty() const +{ + return empty_keys() && empty_mouse (); +} + void Bindings::set_action_map (ActionMap& am) { @@ -253,7 +271,7 @@ Bindings::activate (KeyboardKey kb, Operation op) if (k == kbm->end()) { /* no entry for this key in the state map */ - return false; + return false; } /* lets do it ... */ @@ -281,7 +299,6 @@ Bindings::add (KeyboardKey kb, Operation op, RefPtr<Action> what) if (k == kbm->end()) { pair<KeyboardKey,RefPtr<Action> > newpair (kb, what); kbm->insert (newpair); - // cerr << "Bindings added " << kb.key() << " w/ " << kb.state() << " => " << what->get_name() << endl; } else { k->second = what; } @@ -605,3 +622,8 @@ ActionMap::register_toggle_action (const char* path, actions.insert (_ActionMap::value_type (fullpath, act)); return act; } + +std::ostream& operator<<(std::ostream& out, Gtkmm2ext::KeyboardKey& k) { + return out << "Key " << k.key() << " state " << k.state(); +} + |