[xmonad] More restricted version of XMonad.Actions.UpdatePointer

adam vogt vogt.adam at gmail.com
Sun Mar 13 19:18:44 CET 2011


On Fri, Mar 11, 2011 at 9:56 PM, Weeble <clockworksaint at gmail.com> wrote:
> Right now I use updatePointer to move the pointer to the focused
> window. The main scenario where I want this is when I'm switching
> between windows with the keyboard and then decide to use the mouse for
> something - it can then be surprising that the mouse pointer is in a
> window without keyboard focus and that I need to move it out and back
> in again to get it back. However, there are various situations where
> it triggers when I don't want it, especially with applications that
> try to be clever with lots of small floating windows. I would quite
> like to restrict it only to trigger when I issue a MOD+J or MOD+K
> command to xmonad. Is that possible? Perhaps I can just rebind those
> keys in some way to roll in the pointer moving behaviour, and not
> bother with updatePointer?

Weeble,

That's exactly the right idea. You could bind to M-j, M-k like that in
this config:

import qualified XMonad.StackSet as W; import XMonad
import XMonad.Actions.UpdatePointer
import XMonad.Util.EZConfig

up = updatePointer $ TowardsCentre 0.2 0.2

main = xmonad $ defaultConfig `additionalKeysP`
    [("M-j", do windows W.focusDown; up),
     ("M-k", do windows W.focusUp;   up)]

Adam



More information about the xmonad mailing list