]> Dogcows Code - chaz/openbox/blobdiff - scripts/behavior.py
dont skip ungrab corssing events
[chaz/openbox] / scripts / behavior.py
index 3b407e101d1a3d6c690649785d5f697e64811c4f..fd79b4f878a4cd08dd9985e126c2d9e1d78bee7d 100644 (file)
@@ -6,6 +6,7 @@
 
 import ob
 import callbacks
+import motion
 
 def setup_window_clicks():
     """Sets up the default bindings for various mouse buttons for various
@@ -26,16 +27,26 @@ def setup_window_clicks():
         * Double-left click on a window's titlebar will toggle shading it
     """
     ob.mbind("A-Left", ob.MouseContext.Frame,
-             ob.MouseAction.Motion, callbacks.move)
+             ob.MouseAction.Motion, motion.move)
+    ob.mbind("A-Left", ob.MouseContext.Frame,
+             ob.MouseAction.Release, motion.end_move)
+    ob.mbind("Left", ob.MouseContext.Titlebar,
+             ob.MouseAction.Motion, motion.move)
     ob.mbind("Left", ob.MouseContext.Titlebar,
-             ob.MouseAction.Motion, callbacks.move)
+             ob.MouseAction.Release, motion.end_move)
     ob.mbind("Left", ob.MouseContext.Handle,
-             ob.MouseAction.Motion, callbacks.move)
+             ob.MouseAction.Motion, motion.move)
+    ob.mbind("Left", ob.MouseContext.Handle,
+             ob.MouseAction.Release, motion.end_move)
 
     ob.mbind("A-Right", ob.MouseContext.Frame,
-             ob.MouseAction.Motion, callbacks.resize)
+             ob.MouseAction.Motion, motion.resize)
+    ob.mbind("A-Right", ob.MouseContext.Frame,
+             ob.MouseAction.Release, motion.end_resize)
     ob.mbind("Left", ob.MouseContext.Grip,
-             ob.MouseAction.Motion, callbacks.resize)
+             ob.MouseAction.Motion, motion.resize)
+    ob.mbind("Left", ob.MouseContext.Grip,
+             ob.MouseAction.Release, motion.end_resize)
 
     ob.mbind("Left", ob.MouseContext.Titlebar,
              ob.MouseAction.Press, callbacks.raise_win)
@@ -61,6 +72,12 @@ def setup_window_buttons():
              ob.MouseAction.Click, callbacks.close)
     ob.mbind("Left", ob.MouseContext.IconifyButton,
              ob.MouseAction.Click, callbacks.iconify)
+    ob.mbind("Left", ob.MouseContext.MaximizeButton,
+             ob.MouseAction.Click, callbacks.toggle_maximize)
+    ob.mbind("Middle", ob.MouseContext.MaximizeButton,
+             ob.MouseAction.Click, callbacks.toggle_maximize_vert)
+    ob.mbind("Right", ob.MouseContext.MaximizeButton,
+             ob.MouseAction.Click, callbacks.toggle_maximize_horz)
 
 def setup_scroll():
     """Sets up the default behaviors for the mouse scroll wheel.
@@ -79,14 +96,20 @@ def setup_scroll():
              ob.MouseAction.Click, callbacks.next_desktop)
     ob.mbind("A-Up", ob.MouseContext.Root,
              ob.MouseAction.Click, callbacks.next_desktop)
+    ob.mbind("Up", ob.MouseContext.Root,
+             ob.MouseAction.Click, callbacks.next_desktop)
     ob.mbind("A-Down", ob.MouseContext.Frame,
              ob.MouseAction.Click, callbacks.prev_desktop)
     ob.mbind("A-Down", ob.MouseContext.Root,
              ob.MouseAction.Click, callbacks.prev_desktop)
+    ob.mbind("Down", ob.MouseContext.Root,
+             ob.MouseAction.Click, callbacks.prev_desktop)
 
     ob.mbind("C-A-Up", ob.MouseContext.Frame,
              ob.MouseAction.Click, callbacks.send_to_next_desktop)
     ob.mbind("C-A-Down", ob.MouseContext.Frame,
              ob.MouseAction.Click, callbacks.send_to_prev_desktop)
 
+export_functions = setup_window_clicks, setup_window_buttons, setup_scroll
+
 print "Loaded behavior.py"
This page took 0.021706 seconds and 4 git commands to generate.