Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A haskell program that controls the mouse

Tags:

io

haskell

mouse

First the anecdote: I was playing a browser game, and though it was kind of fun, I found that "grinding" was actually very well rewarded. It was also the case that a simple mouse-clicker program could do the job for you. I then started to wonder how I could make a Haskell program that controlled the mouse. Alas, after a somewhat disappointing Google search, all I could find was people referring to GLUT and a few other modules that supported reactions to mouse input instead of giving mouse output.

Now the question: What Haskell packages support mouse output, and where can I learn more?

like image 940
Undreren Avatar asked Aug 10 '12 06:08

Undreren


1 Answers

The X11 package offers warpPointer for moving the mouse and sendEvent for simulating clicks. I'm not 100% sure about how to set up an event pointer to hand off to sendEvent, though; it's possible that the current bindings don't include the necessary functions. Patches welcome!

like image 66
Daniel Wagner Avatar answered Sep 28 '22 17:09

Daniel Wagner