diff options
author | Andrea Rossato <andrea.rossato@unibz.it> | 2007-06-14 16:44:26 +0200 |
---|---|---|
committer | Andrea Rossato <andrea.rossato@unibz.it> | 2007-06-14 16:44:26 +0200 |
commit | f7422e1f2d000845be8d8dbaa158c1c24ee31b41 (patch) | |
tree | 7caa1329d303c49a4a2a4eab724509c188e9a614 /Warp.hs | |
parent | 52f7beebd32cb6acedfac32df7196a6c422ef340 (diff) | |
download | XMonadContrib-f7422e1f2d000845be8d8dbaa158c1c24ee31b41.tar.gz XMonadContrib-f7422e1f2d000845be8d8dbaa158c1c24ee31b41.tar.xz XMonadContrib-f7422e1f2d000845be8d8dbaa158c1c24ee31b41.zip |
Warp.hs: info and documentation
darcs-hash:20070614144426-32816-3a83cfbe88d90218d94294a12921a845bcc0735d.gz
Diffstat (limited to '')
-rw-r--r-- | Warp.hs | 52 |
1 files changed, 36 insertions, 16 deletions
@@ -1,19 +1,24 @@ -module XMonadContrib.Warp where - -{- Usage: - - This can be used to make a keybinding that warps the pointer to a given - - window or screen. For example, I've added the following keybindings to - - my Config.hs: - - - - , ((modMask, xK_z ), warpToWindow (1%2) (1%2)) -- @@ Move pointer to currently focused window - - - - -- mod-ctrl-{w,e,r} @@ Move mouse pointer to screen 1, 2, or 3 - - ++ - - [((modMask .|. controlMask, key), warpToScreen sc (1%2) (1%2)) - - | (key, sc) <- zip [xK_w, xK_e, xK_r] [0..]] - - - - Note that warping to a particular screen may change the focus. - -} +----------------------------------------------------------------------------- +-- | +-- Module : XMonadContrib.Warp +-- Copyright : (c) daniel@wagner-home.com +-- License : BSD3-style (see LICENSE) +-- +-- Maintainer : daniel@wagner-home.com +-- Stability : unstable +-- Portability : unportable +-- +-- This can be used to make a keybinding that warps the pointer to a given +-- window or screen. +-- +----------------------------------------------------------------------------- + +module XMonadContrib.Warp ( + -- * Usage + -- $usage + warpToScreen, + warpToWindow + ) where import Data.Ratio import Data.Maybe @@ -23,6 +28,21 @@ import Graphics.X11.Xlib.Extras import Operations import XMonad +{- $usage +This can be used to make a keybinding that warps the pointer to a given +window or screen. For example, I've added the following keybindings to +my Config.hs: + +> , ((modMask, xK_z ), warpToWindow (1%2) (1%2)) -- @@ Move pointer to currently focused window +> +>-- mod-ctrl-{w,e,r} @@ Move mouse pointer to screen 1, 2, or 3 +> +> [((modMask .|. controlMask, key), warpToScreen sc (1%2) (1%2)) +> | (key, sc) <- zip [xK_w, xK_e, xK_r] [0..]] + +Note that warping to a particular screen may change the focus. +-} + fraction :: (Integral a, Integral b) => Rational -> a -> b fraction f x = floor (f * fromIntegral x) |