chris | 27 Jul 2012 06:27
Picon
Gravatar

How to move mouse to corner automatically ? -- improve the wiki code.

I found on Awesome wiki has a tip for move mouse to corner.

But I hope to improve it, when mouse has not been used by a time. Then Awesome 
do it automatically.

Here is my code. But "Question", I do not know how to detect mouse's status, and 
how long mouse has been slept.

    local saftCoords = {x=1920, y=1080}
    local moveMouseOnStartup = true -- tell Awesome to do this at startup
    local function moveMouse(x_co, y_co)
        mouse.coords({ x=x_co, y=y_co })
    end

    if moveMouseOnStartup then
        moveMouse(saftCoords.x, saftCoords.y)
    end

    -- TODO when mouse sleep for a time, then automatically move to corner.
    mousetimer = timer({ timeout = 60*1 })
    mousetimer:add_signal("timeout", function()

        moveMouse(saftCoords.x, saftCoords.y)

    end)
    mousetimer:start()

--

-- 
[ stardiviner ] ^^&^^ {I hate all of you !  Leave me alone}
IRC(freenode): stardiviner     \\ Twitter:   <at> numbchild \\
(Continue reading)

Gregor Zattler | 27 Jul 2012 09:24
Picon
Picon

Re: How to move mouse to corner automatically ? -- improve the wiki code.

Hi Chris,
* chris <numbchild <at> gmail.com> [27. Jul. 2012]:
> I found on Awesome wiki has a tip for move mouse to corner.
> 
> But I hope to improve it, when mouse has not been used by a time. Then Awesome 
> do it automatically.

If it's the visibility of the mouse poiter which annoyes you,
then use "unclutter" instead.

Ciao, Gregor

chris | 27 Jul 2012 11:01
Picon
Gravatar

Re: How to move mouse to corner automatically ? -- improve the wiki code.

Excerpts from [ Gregor Zattler ] //// On [2012-07-27 09:24:26 +0200]:

> Hi Chris,
> * chris <numbchild <at> gmail.com> [27. Jul. 2012]:
> > I found on Awesome wiki has a tip for move mouse to corner.

> > But I hope to improve it, when mouse has not been used by a time. Then Awesome 
> > do it automatically.

> If it's the visibility of the mouse poiter which annoyes you,
> then use "unclutter" instead.

Thanks, I have notice that. This is good.

> Ciao, Gregor

> -- 
> To unsubscribe, send mail to awesome-unsubscribe <at> naquadah.org.

--

-- 
[ stardiviner ] ^^&^^ {I hate all of you !  Leave me alone}
IRC(freenode): stardiviner     \\ Twitter:   <at> numbchild \\
GnuPG Key fingerprint
    >>> 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433

Gmane