Page 1 of 1

Stylus interception

PostPosted: May 5, 2003 @ 1:40am
by Dave Johnston
Err, anyone have any idea how to intercept screen taps/input? Or to put it another more precise way, does anyone know how to take screen input x/y coords, fiddle with their value, then pass them through to the PPC GUI as if nothing ever happened?

The idea being that with such an ability, stylus input could be mirrored invisibly to the user, or indeed manipulated in a far more sensible way :)

I'm sure it's possible - but not sure if it's feasible. I guess Nyditot does a similar thing when it changes/rotates the screen size, but I'm not sure if that's actually an internal kernel operation it uses.

Basically I'd just like to create a more flexible screen alignment tool. Simple, in theory...

Anyone have any ideas or suggestions? I tried the obvious places the best I could, but now I'm all out of leads! :?

PostPosted: May 5, 2003 @ 3:37am
by DillRye

PostPosted: May 5, 2003 @ 4:28am
by RICoder
off the top of my head...
are you trying to do this globaly? you can probably make an invisible widow and do a SetCapture(); on the mouse (which is the stylus) and then get the active window handle and pass the altered message through to it. don't think that is the brightest way to do it though...

PostPosted: May 5, 2003 @ 10:43am
by Dave Johnston

PostPosted: May 5, 2003 @ 9:12pm
by superman

PostPosted: May 7, 2003 @ 10:48am
by Dave Johnston

PostPosted: May 7, 2003 @ 12:09pm
by TechMage

PostPosted: May 11, 2003 @ 4:02am
by Justt
You can always try playing with 'fake' window messages. I once coded a program that tricked a paint application on a website (an oekaki board) to think the user was drawing an image, pixel-per-pixel, by sending thousands of 'fake clicks' to it's HWND.
All I had to do was find the target window using FindWindow(), and then use SendMessage() with WM_LBUTTONDOWN/WM_LBUTTONUP to make it think the user was clicking.

There is a pretty simple way to send a message to all opened windows (excluding their children) in the OS, it's called message broadcasting. For example, by specifying HWND_BROADCAST in SendMessage() all top-level windows receive the message.

Intercepting the stylus should be a bit harder. I haven't ever tried this, but there may be a way to use subclassing for that. If there was an OS-driven window that receives the input and broadcasts it to all other windows, you theorically could subclass it and voila, get control over what the PDA receives from the stylus.

Check MSDN for further information about that. But remember to be careful in playing with such a primary thing like stylus input.


Oh, and if you want a handy tool for some training and testing of how the windows react to window messages, you can use this utility I once wrote:

http://justt.cellosoft.com/files/PostMsg.exe

This is a PC build, but I can give you it's source so you can port it to PPCs, if you're interested.

I hope this helps :)

PostPosted: May 11, 2003 @ 11:45am
by Dave Johnston
Awesome stuff - thanks!

I don't actually mean to try any of this stuff just yet (other work taking priority), but in a few weeks time. I'll post my progress then, but in the meantime, ta for all the advice and pointers. I'm still hoping it's all possible (and in theory, stylus interception should be the easy part of my little project!)

Guess I ought to read up on MFC too...