27 Jul 2012 06:27
How to move mouse to corner automatically ? -- improve the wiki code.
chris <numbchild <at> gmail.com>
2012-07-27 04:27:45 GMT
2012-07-27 04:27:45 GMT
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)
RSS Feed