This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Stylus interception


Stylus interception

Postby Dave Johnston » May 5, 2003 @ 1:40am

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! :?
- Dave Johnston
- http://www.johnsto.co.uk/
User avatar
Dave Johnston
pm Insider
 
Posts: 356
Joined: Mar 31, 2002 @ 6:14pm
Location: UK


Postby DillRye » May 5, 2003 @ 3:37am

User avatar
DillRye
pm Insider
 
Posts: 477
Joined: Apr 25, 2002 @ 7:28am
Location: Iowa State University of Eng


Postby RICoder » May 5, 2003 @ 4:28am

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...
<iframe src="http://gamercard.xbox.com/RICoder.card" scrolling="no" frameBorder="0" height="140" width="204">RICoder</iframe>
User avatar
RICoder
FOX News Correspondent
 
Posts: 3948
Joined: Jul 10, 2001 @ 1:48pm
Location: the matrix has me


Postby Dave Johnston » May 5, 2003 @ 10:43am

User avatar
Dave Johnston
pm Insider
 
Posts: 356
Joined: Mar 31, 2002 @ 6:14pm
Location: UK


Postby superman » May 5, 2003 @ 9:12pm

"Kittens give Morbo gas." - Morbo the News Monster
User avatar
superman
pm Member
 
Posts: 99
Joined: Nov 3, 2001 @ 1:09am


Postby Dave Johnston » May 7, 2003 @ 10:48am

User avatar
Dave Johnston
pm Insider
 
Posts: 356
Joined: Mar 31, 2002 @ 6:14pm
Location: UK


Postby TechMage » May 7, 2003 @ 12:09pm

User avatar
TechMage
pm Insider
 
Posts: 2223
Joined: Sep 16, 2001 @ 5:40pm
Location: In Your Head


Postby Justt » May 11, 2003 @ 4:02am

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 :)
Justt
-
User avatar
Justt
pm Member
 
Posts: 23
Joined: Mar 23, 2003 @ 10:00pm


Postby Dave Johnston » May 11, 2003 @ 11:45am

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...
User avatar
Dave Johnston
pm Insider
 
Posts: 356
Joined: Mar 31, 2002 @ 6:14pm
Location: UK


Return to Windows Mobile


Sort


Forum Description

A discussion forum for mobile device developers on the Windows Mobile platform. Any platform specific topics are welcome.

Moderators:

Dan East, sponge, Digby, David Horn, Kevin Gelso, RICoder

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron