none
Turning off TabletPC right-click emulation for an application that needs click-and-hold input RRS feed

  • Question

  • I am working on compatibility for an application that needs click-and-hold input from the user.  On TabletPC, the pen settings may be such that a click-and-hold action is interpreted by the system as a "gesture" meaning right-click.  This makes it impossible to interact with the application as necessary.  How can this behavior be disabled entirely, such that the click is sent as a WM_LBUTTONDOWN as intended, and so that the confusing ring-of-spheres graphic does not appear?

     

    - Casey

     

    Wednesday, February 6, 2008 3:21 AM

Answers

  • Hello Casey.

     

    To disable the default behavior of the press and hold gesture, you must set a property associated with the MicrosoftTabletPenServiceProperty atom. Call the Win32 GlobalAddAtom function to get the ID for the MicrosoftTabletPenServiceProperty atom from the Windows global atom table. Once you have the atom ID and the handle of the window for which you wish to disable the gesture, set the property by calling to the Win32 SetProp function. This disables the press and hold gesture.

     

    Please take a look at Disabling Press and Hold in Applications Written for Tablet PC, written by Mark Hopkins, for the full text and code sample. I believe that this should have all the information you need.

     

    Let me know if you run into any problems. Please mark this post as the answer if it solves your issue.

     

    Thanks,

     

    Eliot - MSFT

    Thursday, February 7, 2008 10:26 PM

All replies

  • I have an application that requires immediate processing of input when the user presses and holds the left mouse button.  However, on a Tablet PC, the tablet settings may have right-click emulation turned on for the behavior of pressing the pen to the surface without moving.  The result is that wisptis fails to generate a WM_LBUTTONDOWN, and instead prefers to draw a "ring of red spheres with a mouse icon" graphic on the screen.  This graphic blinks for a while, then disappears and (finally) sends a WM_RBUTTONDOWN message in lieu of a WM_LBUTTONDOWN.

    This application does not need right-click interaction at all, and so this is a completely useless emulation that irreperably ruins the user's ability to interact with the application.  How can I turn it off completely?

    - Casey

    Wednesday, February 6, 2008 3:04 AM
  • Hello Casey.

     

    To disable the default behavior of the press and hold gesture, you must set a property associated with the MicrosoftTabletPenServiceProperty atom. Call the Win32 GlobalAddAtom function to get the ID for the MicrosoftTabletPenServiceProperty atom from the Windows global atom table. Once you have the atom ID and the handle of the window for which you wish to disable the gesture, set the property by calling to the Win32 SetProp function. This disables the press and hold gesture.

     

    Please take a look at Disabling Press and Hold in Applications Written for Tablet PC, written by Mark Hopkins, for the full text and code sample. I believe that this should have all the information you need.

     

    Let me know if you run into any problems. Please mark this post as the answer if it solves your issue.

     

    Thanks,

     

    Eliot - MSFT

    Thursday, February 7, 2008 10:26 PM
  • Thank you very much for the prompt reply.

    I strongly encourage you to add this to the MSDN documentation... there is literally no mention of this atom's existence anywhere in the Tablet PC SDK.  In fact, after reading your e-mail, I searched for the atom name on all of MSDN and the only place it is ever mentioned at all is in that technical article, which no one will ever find if they don't know about the atom name in the first place!

    Maybe just include that article in the TabletPC SDK, and make sure it is in the table of contents somewhere?  I think it would save people a lot of hunting.

    - Casey

    Monday, February 11, 2008 11:04 AM
  • Anyway to change other properties? like the "waittime" for press and hold  or "hoverlimit"...
    those in the registry HKCU\Software\Microsoft\wisp\Pen\......

    Thanks
    -chueh8
    Thursday, March 12, 2009 6:59 PM
  • but it still takes long time send the first WM_LBUTTONDOWN message when press and hold.
    how to let the press and hold generate the WM_LBUTTONDOWN immediately?
    I am using win7 build 7100, on old version , it's ok.
    thanks!
    Friday, May 15, 2009 7:31 AM