mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-07-26 01:31:52 -07:00
Doc/Extending.hs: add a section about configuring mouse bindings.
This commit is contained in:
@@ -68,6 +68,9 @@ module XMonad.Doc.Extending
|
||||
-- *** Adding and removing key bindings
|
||||
-- $keyAddDel
|
||||
|
||||
-- ** Editing mouse bindings
|
||||
-- $mouse
|
||||
|
||||
-- ** Editing the layout hook
|
||||
-- $layoutHook
|
||||
|
||||
@@ -580,6 +583,29 @@ function in particular.
|
||||
|
||||
-}
|
||||
|
||||
{- $mouse
|
||||
#Editing_mouse_bindings#
|
||||
|
||||
Most of the previous discussion of key bindings applies to mouse
|
||||
bindings as well. For example, you could configure button4 to close
|
||||
the window you click on like so:
|
||||
|
||||
> import qualified Data.Map as M
|
||||
>
|
||||
> myMouse x = [ (0, button4), (\w -> focus w >> kill) ]
|
||||
>
|
||||
> newMouse x = M.union (mouseBindings defaultConfig x) (M.fromList (myMouse x))
|
||||
>
|
||||
> main = xmonad $ defaultConfig { ..., mouseBindings = newMouse, ... }
|
||||
|
||||
Overriding or deleting mouse bindings works similarly. You can also
|
||||
configure mouse bindings much more easily using the
|
||||
'XMonad.Util.EZConfig.additionalMouseBindings' and
|
||||
'XMonad.Util.EZConfig.removeMouseBindings' functions from the
|
||||
"XMonad.Util.EZConfig" module.
|
||||
|
||||
-}
|
||||
|
||||
{- $layoutHook
|
||||
#Editing_the_layout_hook#
|
||||
|
||||
|
Reference in New Issue
Block a user