summaryrefslogtreecommitdiff
path: root/gtk2_ardour/utils.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2006-05-02 01:08:34 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2006-05-02 01:08:34 +0000
commit979b95a56e0ef76238513ecb42a3b9e7f4be2e58 (patch)
tree6c3469176a2ef15865b572859a6299968656374a /gtk2_ardour/utils.cc
parent433c518dc7c698c4dc41e2b75483718dd918b670 (diff)
enable use of arrow keys, fix hscroller issues, start work on smoother auto-scroll
git-svn-id: svn://localhost/trunk/ardour2@490 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/utils.cc')
-rw-r--r--gtk2_ardour/utils.cc36
1 files changed, 36 insertions, 0 deletions
diff --git a/gtk2_ardour/utils.cc b/gtk2_ardour/utils.cc
index fde9d545bb..c1ad4f6ca7 100644
--- a/gtk2_ardour/utils.cc
+++ b/gtk2_ardour/utils.cc
@@ -396,6 +396,42 @@ key_press_focus_accelerator_handler (Gtk::Window& window, GdkEventKey* ev)
all "normal text" accelerators.
*/
+
+ if (!special_handling_of_unmodified_accelerators) {
+
+ /* pretend that certain key events that GTK does not allow
+ to be used as accelerators are actually something that
+ it does allow.
+ */
+
+ int ret = false;
+
+ switch (ev->keyval) {
+ case GDK_Up:
+ ret = gtk_accel_groups_activate(G_OBJECT(win), GDK_uparrow, GdkModifierType(ev->state));
+ break;
+
+ case GDK_Down:
+ ret = gtk_accel_groups_activate(G_OBJECT(win), GDK_downarrow, GdkModifierType(ev->state));
+ break;
+
+ case GDK_Right:
+ ret = gtk_accel_groups_activate(G_OBJECT(win), GDK_rightarrow, GdkModifierType(ev->state));
+ break;
+
+ case GDK_Left:
+ ret = gtk_accel_groups_activate(G_OBJECT(win), GDK_leftarrow, GdkModifierType(ev->state));
+ break;
+
+ default:
+ break;
+ }
+
+ if (ret) {
+ return true;
+ }
+ }
+
if (!special_handling_of_unmodified_accelerators ||
ev->state & (Gdk::MOD1_MASK|
Gdk::MOD2_MASK|