5

I would like to echo keyboard input to the operating system (ubuntu) from haskell. More specifically, I"m parsing a binary signal and I would like to turn it into keyboard input. I am not trying to capture keyboard input into the program.

Is there a haskell package that enables this? If not, is there a good attack strategy?

Peter Klipfel
  • 4,958
  • 5
  • 29
  • 44
  • The Ubuntu OS as such isn't concerned with keys. (Unlike Windows, Linux OSs make a proper distinction about what's an OS and what's its user interface.) I suppose you want to send keyboard events to _the [X server](http://en.wikipedia.org/wiki/X11_server)_? Or indeed to a particular running application? – leftaroundabout Apr 06 '14 at 01:08
  • I wasn't aware that key events went to X, but that makes sense. I want the keystrokes to be sent to the x server and let it handle delegation to the currently active window or whatever. – Peter Klipfel Apr 06 '14 at 22:31
  • In X, one way of doing that is with XTest. There's a library that already wraps the Xtest protocol in haskell: http://hackage.haskell.org/package/robot-1.2 - any use to you? – bazzargh Apr 06 '14 at 23:19

1 Answers1

1

Ok, so I ended up using the Test.Robot library. It is not portable across operating systems, but I can now type with a midi controller. If anyone is interested, the code is on github.

Peter Klipfel
  • 4,958
  • 5
  • 29
  • 44