diff options
Diffstat (limited to 'src/Internal/Keys.hs')
| -rw-r--r-- | src/Internal/Keys.hs | 36 |
1 files changed, 7 insertions, 29 deletions
diff --git a/src/Internal/Keys.hs b/src/Internal/Keys.hs index fcf233e..6d34c4a 100644 --- a/src/Internal/Keys.hs +++ b/src/Internal/Keys.hs @@ -46,6 +46,7 @@ import XMonad.Actions.SpawnOn as SpawnOn import qualified Data.Map as Map import qualified XMonad.StackSet as W +import Internal.MouseMotion import Internal.Windows import Internal.Lib import Internal.DMenu @@ -356,34 +357,8 @@ keymap = runKeys $ do bind xK_q $ (justMod -|- noMod) $ - let fi = fromIntegral - mag (fi -> x₁, fi -> y₁) (fi -> x₂, fi -> y₂) = - sqrt ((x₂ - x₁) ^ 2 + (y₂ - y₁) ^ 2) in - - doc "EXPERIMENTAL: Move mouse to control media." $ fix $ \recur -> do - - -- Moving the mouse 100+ pixels to the right will go to the next song - -- Moving the mouse 100+ pixel to the left will go to the prior song - -- Moving the mouse vertically 100+ pixels will stop the loop - -- - -- May mess up the mouse, requiring an XMonad reboot, which is why - -- this is experimental. It's not the most practical bindings in the - -- world, but it shows that it's theoretically possible to program - -- some neat mouse moptions to do cool things. - firstMotion@(x, y) <- nextMotion - (x', y') <- iterateWhile ((<100) . mag firstMotion) nextMotion - - - if abs (y' - y) > abs (x' - x) - then - if (y' - y) < 0 - then logs "up" - else logs "down" - else do - if (x' - x) < 0 - then mediaPrev - else mediaNext - recur + doc "EXPERIMENTAL: Move mouse to control media." $ + mouseRotateMotion (logs "CW") (logs "CCW") bind xK_r $ do justMod $ doc "Run a command via Rofi" runDMenu @@ -625,9 +600,12 @@ mouseMap = runButtons $ do bind button13 $ noMod $ subMouse $ do bind button1 $ noMod mouseMoveWindow + bind button2 $ noMod $ windows . W.sink bind button3 $ noMod mouseResizeWindow - bind button13 $ noMod $ windows . W.sink + bind button13 $ noMod $ subMouse $ do + bind button13 $ noMod $ subMouse $ do + bind button13 $ noMod $ noWindow $ spawnX "xsecurelock" bind button15 $ do |