[beast: 136/144] BST: allow ALT + mouse button 1 as movement alternative to button 2



commit b58363d23fb390e93c0a721902e909fa21064644
Author: Tim Janik <timj gnu org>
Date:   Thu Jan 17 03:49:39 2013 +0100

    BST: allow ALT + mouse button 1 as movement alternative to button 2

 beast-gtk/bstutils.cc |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/beast-gtk/bstutils.cc b/beast-gtk/bstutils.cc
index 83e303e..1960187 100644
--- a/beast-gtk/bstutils.cc
+++ b/beast-gtk/bstutils.cc
@@ -1345,6 +1345,12 @@ shift_event (GdkEvent *event)
 }
 
 static bool
+alt_event (GdkEvent *event)
+{
+  return (event->button.state & GDK_MOD1_MASK) != 0;
+}
+
+static bool
 button_event (GdkEvent *event)
 {
   return event->type == GDK_BUTTON_PRESS || event->type == GDK_BUTTON_RELEASE;
@@ -1371,7 +1377,8 @@ bst_mouse_button_activate2 (GdkEvent *event)
 bool
 bst_mouse_button_move (GdkEvent *event)
 {
-  return button_event (event) && event->button.button == 2;
+  return button_event (event) && (event->button.button == 2 ||
+                                  (alt_event (event) && event->button.button == 1));
 }
 
 bool



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]