Tuesday 15 March 2011

haskell - Fake key presses using XHB -


I am trying to emulate key presses using XHB and XTest using it as a reference, unfortunately From, whatever I did, as a result the program has no effect. No exceptions, no warning, no warning.

Any thoughts?

I am using XHB 0.5.2012.11.23, GHC 7.4.1 at Ubuntu 12.04.

What has got so far:

  import control. Import import. Import import graphics. Xhb import graphics XHB.Gen.Test Main = Just C & LT; - to connect keycode = 38 - forever fake INPUT C $ MKFakeInput (toBit 'EventMaskKeyPress) keyCode 0 (fromXid xidNone) 0 0 thread $ 1 * 1000 fakeInput c $ MkFakeInput (toBit' EventMaskKeyRelease) keycode 0 (fromXid xidNone ) 0 0 Thread $ $ 1 * 1000 tobit ':: (Bitumen A, Integral B) = & gt; A - & gt; The point here is a little subtle if you see that the 'point' it does not require you  FAKE_EVENT   EVENT_MASK , but instead a  FAKE_EVENT_TYPE  is expected  key and press  to  FAKE_EVENT_TYPE   2  while  KeyRelease  is  3 . These values ​​required things work as  EventMaskKeyPress  and  EventMaskKeyRelease  Location (Also, you dirty  toBit  rape Not necessarily, which was the smell that used to point me towards this wrong).   

No comments:

Post a Comment