diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2010-08-12 21:02:01 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2010-08-12 21:02:01 +0000 |
commit | 9196535878dfe2a6eb7bde909b0b2312ade8ad29 (patch) | |
tree | 96ff27d4f43a23fce93b30781e9957eb7ce457ab /libs/gtkmm2ext/bindings.cc | |
parent | eee61a9f9bf297d454e07bd2e2b9d3d1824b8272 (diff) |
lotsa keybindings for nearly everything in the step editor
git-svn-id: svn://localhost/ardour2/branches/3.0@7610 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/gtkmm2ext/bindings.cc')
-rw-r--r-- | libs/gtkmm2ext/bindings.cc | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/libs/gtkmm2ext/bindings.cc b/libs/gtkmm2ext/bindings.cc index af709b49b6..12c37f1095 100644 --- a/libs/gtkmm2ext/bindings.cc +++ b/libs/gtkmm2ext/bindings.cc @@ -10,6 +10,24 @@ using namespace Glib; using namespace Gtk; using namespace Gtkmm2ext; +uint32_t KeyboardKey::_ignored_state = 0; + +KeyboardKey::KeyboardKey (uint32_t state, uint32_t keycode) +{ + uint32_t ignore = _ignored_state; + + if (gdk_keyval_is_upper (keycode) && gdk_keyval_is_lower (keycode)) { + /* key is not subject to case, so ignore SHIFT + */ + ignore |= GDK_SHIFT_MASK; + } + + _val = (state & ~ignore); + _val <<= 32; + _val |= keycode; +}; + + string KeyboardKey::name () const { @@ -126,7 +144,6 @@ Bindings::activate (KeyboardKey kb, KeyboardKey::Operation op) /* lets do it ... */ - cerr << "Firing up " << k->second->get_name() << endl; k->second->activate (); return true; } @@ -150,6 +167,7 @@ Bindings::add (KeyboardKey kb, KeyboardKey::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() << endl; } else { k->second = what; } |