none
How to turn off filtering of tablet->mouse events RRS feed

  • Question

  • I am using Windows XP Tablet Edition. I've written a program which hooks into the normal Windows mouse events, WM_MOUSEMOVE etc., and writes on a canvas. (I want to use regular Windows API if possible, not the Tablet API, because I want my software to also work on a SMART interactive whiteboard, and that does not present itself as a tablet.)

    The problem is that the mouse messages are being fiddled with before they reach my application. I found that if I make long strokes and pause between strokes then the mouse messages are sent properly. But if I make several rapid short strokes, then something is doing unhelpful pre-processing. Specifically, if I make a down-stroke about 10 pixels long, and then make another downstroke about five pixels to the right of the first, then the second WM_MOUSEDOWN reports that it comes from exactly the same place as the first.

    This looks like some sort of pre-processing, so that naive applications don't get confused about double-clicks. But for my application, where I want very faithful response to rapid gestures, it's unhelpful.

    I found a reference to the MicrosoftTabletPenServiceProperty atom, and to CS_DBLCLKS window style, and I turned them both off with the following piece of Python code:
    1 hwnd = self.GetHandle()  
    2 tablet_atom = "MicrosoftTabletPenServiceProperty" 
    3 atom_ID = windll.kernel32.GlobalAddAtomA(tablet_atom)  
    4 windll.user32.SetPropA(hwnd,tablet_atom,1)  
    5 currentstyle = windll.user32.GetClassLongA(hwnd, win32con.GCL_STYLE)  
    6 windll.user32.SetClassLongA(hwnd, win32con.GCL_STYLE, currentstyle & ~win32con.CS_DBLCLKS) 
    But it has no effect.

    I tried writing a low-level hook for the mouse driver, with SetWindowsHookEx, but it doesn't work -- obviously the mouse messages are being pre-processed even before they are sent to my low-level Windows hook.

    I would be very grateful for advice about how to turn off this pre-processing. (The alternative, using something like RealTimeStylus, I am also having problems with -- described in a separate post.)

    Damon.
    Sunday, January 18, 2009 8:08 PM