none
Disable Press & Hold RRS feed

  • Question

  • Hi there,

    we're currently having an application context where it's neccessary to disable press & hold. In this context we do want to track the begin of the touch event until its release. Up to now it's every time interrupted by the right click transformation.

    Is there a possibility to disable press & hold for a single application?

    Any help would be appreciated.

    Thanks in advance,
    Peter

    Tuesday, May 19, 2015 8:29 AM

Answers

  • Thanks for your help. Finally it turned out that our touch controller somtimes flickered.
    • Marked as answer by pkuebler Thursday, August 27, 2015 9:14 AM
    Thursday, August 27, 2015 9:14 AM

All replies

  • I believe that it is you your application that is responding to the tap and hold, or right click.  So, since your application is responding, change your code to not respond.  Hint: your code handles it by default because you don't handle it and the base class handles it.

    But, why would tap and hold effect your ability to detect mouse up events?   I assume that you are capturing the time on the mouse down, then again on mouse up and calculating the delta.


    Bruce Eitman (eMVP) Senior Engineer Bruce.Eitman AT Eurotech DOT com My BLOG http://geekswithblogs.net/bruceeitman Eurotech Inc. www.Eurotech.com

    Wednesday, May 20, 2015 1:22 PM
    Moderator
  • I don't know if could be usefull, but in my Windows desktop application I use this code:

    // Toggle the press and hold gesture for the given window
    // Vedi http://msdn.microsoft.com/en-us/library/ms812373.aspx
    bool TogglePressAndHold(HWND hWnd, bool enable)
    {
        // The atom identifier and Tablet PC atom
        ATOM atomID = 0;
        LPCTSTR tabletAtom = _T("MicrosoftTabletPenServiceProperty");
    
        // Get the Tablet PC atom ID
        atomID = GlobalAddAtom(tabletAtom);
    
        // If getting the ID failed, return false
        if (atomID == 0) {
            return false;
        }
    
        // Enable or disable the press and hold gesture
        if (enable) {
            // Try to enable press and hold gesture by 
            // clearing the window property, return the result
            return RemoveProp(hWnd, tabletAtom) ? true : false;
        }
        else {
            // Try to disable press and hold gesture by 
            // setting the window property, return the result
            return SetProp(hWnd, tabletAtom, (HANDLE)1) ? true : false;
        }
    }
    
    Tuesday, May 26, 2015 10:10 AM
  • Thanks for your help. Finally it turned out that our touch controller somtimes flickered.
    • Marked as answer by pkuebler Thursday, August 27, 2015 9:14 AM
    Thursday, August 27, 2015 9:14 AM