Beispiel #1
0
func (cmd MovePointer) Run() gribble.Value {
	return syncRun(func() gribble.Value {
		xproto.WarpPointer(wm.X.Conn(), 0, wm.X.RootWin(), 0, 0, 0, 0,
			int16(cmd.X), int16(cmd.Y))
		return nil
	})
}
Beispiel #2
0
func (cmd MovePointerRelative) Run() gribble.Value {
	return syncRun(func() gribble.Value {
		geom := wm.Workspace().Geom()
		xproto.WarpPointer(wm.X.Conn(), 0, wm.X.RootWin(), 0, 0, 0, 0,
			int16(geom.X()+cmd.X), int16(geom.Y()+cmd.Y))
		return nil
	})
}
Beispiel #3
0
func (cmd MovePointerRelative) Run() gribble.Value {
	return syncRun(func() gribble.Value {
		geom := wm.Workspace().Geom()
		x, xok := parsePos(geom, cmd.X, false)
		y, yok := parsePos(geom, cmd.Y, true)
		if !xok || !yok {
			return nil
		}
		xproto.WarpPointer(wm.X.Conn(), 0, wm.X.RootWin(), 0, 0, 0, 0,
			int16(geom.X()+x), int16(geom.Y()+y))
		return nil
	})
}