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

Can you please tell me how I can reload a windows form without closing
Please any on tell me can i use Sqlite database in my Windows Phone
[Disclaimer: this is a Windows 7 specific issue as far as I can tell]
Possible Duplicate: Can I tell Linux not to swap out a particular processes' memory?
I was wondering if there is a Windows API that can tell me if
Can Any body tell why window class library can't be added in the silverlight
Anyone can tell me which one is better (JAXB or Apache XMLBeans) taking in
Anyone can tell me what I'm doing wrong? I am creating a simple system
Which API can tell me the information about if LED is supported by a
so from what i can tell, you have to specify artifacts and working directory

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.