summaryrefslogtreecommitdiff
path: root/gtk2_ardour/keyboard.h
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2008-09-10 15:03:30 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2008-09-10 15:03:30 +0000
commit68e943265edf04e63a8e8b8f62bab20f99d9c637 (patch)
treeff8941a59662fc0c4622944b65f7b2d5e3bdd0c3 /gtk2_ardour/keyboard.h
parente4372df05b7d74a6b80dbbf4b6c00cc2b31c4723 (diff)
merge from 2.0-ongoing @ 3581
git-svn-id: svn://localhost/ardour2/branches/3.0@3711 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/keyboard.h')
-rw-r--r--gtk2_ardour/keyboard.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/gtk2_ardour/keyboard.h b/gtk2_ardour/keyboard.h
index de2a0929ed..e6d5065e86 100644
--- a/gtk2_ardour/keyboard.h
+++ b/gtk2_ardour/keyboard.h
@@ -20,18 +20,19 @@
#ifndef __ardour_keyboard_h__
#define __ardour_keyboard_h__
+#include <map>
#include <vector>
#include <string>
#include <sigc++/signal.h>
#include <gtk/gtk.h>
+#include <gtkmm/accelkey.h>
#include <ardour/types.h>
#include <pbd/stateful.h>
#include "selection.h"
-using std::vector;
using std::string;
class Keyboard : public sigc::trackable, PBD::Stateful
@@ -43,7 +44,7 @@ class Keyboard : public sigc::trackable, PBD::Stateful
XMLNode& get_state (void);
int set_state (const XMLNode&);
- typedef vector<uint32_t> State;
+ typedef std::vector<uint32_t> State;
typedef uint32_t ModifierMask;
static uint32_t PrimaryModifier;
@@ -114,12 +115,23 @@ class Keyboard : public sigc::trackable, PBD::Stateful
static void magic_widget_drop_focus ();
static void setup_keybindings ();
+ static void keybindings_changed ();
static void save_keybindings ();
static bool load_keybindings (std::string path);
static void set_can_save_keybindings (bool yn);
static std::string current_binding_name () { return _current_binding_name; }
static std::map<std::string,std::string> binding_files;
+ struct AccelKeyLess {
+ bool operator() (const Gtk::AccelKey a, const Gtk::AccelKey b) const {
+ if (a.get_key() != b.get_key()) {
+ return a.get_key() < b.get_key();
+ } else {
+ return a.get_mod() < b.get_mod();
+ }
+ }
+ };
+
private:
static Keyboard* _the_keyboard;
@@ -134,8 +146,13 @@ class Keyboard : public sigc::trackable, PBD::Stateful
static Gtk::Window* current_window;
static std::string user_keybindings_path;
static bool can_save_keybindings;
+ static bool bindings_changed_after_save_became_legal;
static std::string _current_binding_name;
+ typedef std::pair<std::string,std::string> two_strings;
+
+ static std::map<Gtk::AccelKey,two_strings,AccelKeyLess> release_keys;
+
static gint _snooper (GtkWidget*, GdkEventKey*, gpointer);
gint snooper (GtkWidget*, GdkEventKey*);