Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 389931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T15:54:54+00:00 2026-05-12T15:54:54+00:00

How can I tell Windows not to do unhelpful pre-processing on tablet pen events?

  • 0

How can I tell Windows not to do unhelpful pre-processing on tablet pen events?

I am programming in Python 2.6, targetting tablet PCs running Windows 7 (though I would like my program to work with little modification on XP with a SMART interactive whiteboard, and for mouse users on Linux/Mac). I’ve written a program which hooks into the normal Windows mouse events, WM_MOUSEMOVE etc., and writes on a canvas.

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, perhaps 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:

hwnd = self.GetHandle()  
tablet_atom = "MicrosoftTabletPenServiceProperty" 
atom_ID = windll.kernel32.GlobalAddAtomA(tablet_atom)  
windll.user32.SetPropA(hwnd,tablet_atom,1)  
currentstyle = windll.user32.GetClassLongA(hwnd, win32con.GCL_STYLE)  
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. I do not want to switch to RealTimeStylus — first because it won’t work on Windows XP plus SMART interactive whiteboard, second because I can’t see how to use RealTimeStylus in CPython, so I would need to switch to IronPython, and then my code would no longer run on Linux/Mac.

Damon.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T15:54:54+00:00Added an answer on May 12, 2026 at 3:54 pm

    For raw mouse messages, you can use WM_INPUT on XP and later. Seven added some touch specific stuff: WM_GESTURE and WM_TOUCH

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I tell when Windows is changing a monitors power state?
I have Perl on Mac, Windows and Ubuntu. How can I tell from within
[Disclaimer: this is a Windows 7 specific issue as far as I can tell]
I was wondering if there is a Windows API that can tell me if
As far as I can tell, this is isn't possible, so I'm really just
As far as I can tell, the best way to do this is do
Could anyone can tell me where I can find full ASP.NET MVC beta documentation?
As far as I can tell the iPhone multitouch framework sends the location of
Are there any tools that can tell me what percentage of a XSL document
IOKit and the DiskArbitration framework can tell me a lot of things about mounted

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.