none
Different handling between touch and mouse RRS feed

  • Question

  • Hello,

    I have a very special problem. My program (WPF,C#,Net 4.7) has some dialogues(Type is Window) which contains Ok/Cancel/.. Buttons. If the dialogues appears and I touch outside of the "dialogue window" I will have to touch the Ok/Cancel/..buttons several times to fire the command or events!? If I test it with mouse, the command/event will get fired by first click.

    If I add the following code  "Disable RealsTimeStylus for WPF Applications" it will also works fine by touch, but multitouch will not work.

    https://docs.microsoft.com/en-us/previous-versions/dotnet/netframework-3.5/dd901337(v=vs.90)

    Any Idea??

    Tuesday, January 8, 2019 3:27 PM

All replies


  • Hi  Hartl_D,

    >>I have a very special problem. My program (WPF,C#,Net 4.7) has some dialogues(Type is Window) which contains Ok/Cancel/.. Buttons. If the dialogues appears and I touch outside of the "dialogue window" I will have to touch the Ok/Cancel/..buttons several times to fire the command or events!? If I test it with mouse, the command/event will get fired by first click.

    Your issue is so strange. As far as I know, Touch events are different than mouse events.

    You can refer the following article/samples. It give a detailed description and implementation.

    WPF and multi-touch: Exploring WPF capabilities, limitations and work-arounds to create state-of-the-art applications with multi-touch features.


    Besides, we can not reproduce your problem. you can upload a running demo to OneDrive(Including your test material). We can download it and debugging. This will help us quickly analyze your problem.

    Best Regards,

    Yong Lu

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, January 9, 2019 6:37 AM
    Moderator
  • You can download an example project from:

    Please click the link below to download the file:

    Testprogram

    To test it make fullscreen.
    • Edited by Hartl_D Wednesday, January 9, 2019 2:35 PM
    Wednesday, January 9, 2019 7:46 AM

  • Hi   Hartl_D,

    You may can try the following suggestion to redirect a touch down event handler to the base button command(may be have a strange).

    Redirect a touch down event to a command

    But, as my understand. The command is a major part of MVVM. The main benefit of using MVVM is that it really helps us to Separate the view and model, Databinding, Testability.

    For more detailed: Why use commands in WPF and not event handlers

    So, When you have a touch device, you need to define the corresponding touch event to handle a series of touch operations

    Best Regards,

    Yong Lu

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, January 10, 2019 8:18 AM
    Moderator
  • Hi,

    I've already tested with events, but events didn't get fired.

    Thursday, January 10, 2019 8:34 AM
  • Hi   Hartl_D,

    I suggest you can try to define the corresponding touch event to handle a series of touch operations instead of using a command to include all input operations. This can avoid some strange phenomena.


    Best Regards,

    Yong Lu

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, January 10, 2019 9:44 AM
    Moderator
  • Hi, 

    The problem is there will not be fired any event....

    BR,

    Daniel

    Friday, January 11, 2019 5:51 AM

  • Hi  Hartl_D,  

    >>The problem is there will not be fired any event....

    I have define TouchDown or TouchUp event. It will trigger event when clicked. You need to handle a series of touch operations instead of using a command to include all input operations.

    You may have some issue with your device or drivers.

    Best Regards,

    Yong Lu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, January 14, 2019 6:37 AM
    Moderator
  • Did you try my example?
    Tuesday, January 15, 2019 2:24 PM

  • Hi     Hartl_D,

    >>Did you try my example?

    Yes, I have tried on my side. I have define TouchDown or TouchUp event. It will trigger event when clicked.

    >>The problem is there will not be fired any event

    You may have some issue with your device or drivers.

    Best Regards,

    Yong Lu

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, January 16, 2019 2:00 AM
    Moderator
  • I've already tested on different devices, always same handling. 

    I've traced the events with snoop:

    First picture OK:

    Second Not OK:

    OK

    OK

    NOK

    Not OK

    Friday, February 1, 2019 7:47 AM
  • Hi   Hartl_D,

    >>I've already tested on different devices, always same handling. 

    I've traced the events with snoop:

    First picture OK:

    Second Not OK:

    You may can show us the different device's OS build version and device's model.

    I found the two pictures have the same event, one is working and the other is not working(for example: StylusEnter on border(Border)). We can not understand clearly.

    Best Regards,

    Yong Lu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, February 4, 2019 2:07 AM
    Moderator
  • Both pictures/tests were made with the same device and I#ve already tested on different devices(also Win7 and Win10)

    I've found this:

    https://github.com/dotnet/wpf/issues/194

    I think it is the same issue...

    Wednesday, February 6, 2019 7:59 AM
  • Hi  Hartl_D,   

    I found the two pictures have the same event, one is working and another is not working(for example: StylusEnter on border(Border)). Do these events some works well on Win7 and not work on Win10? 


    Best Regards,

    Yong Lu

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, February 12, 2019 7:55 AM
    Moderator
  • Hello ,

    I've tested it also on different windows 7 devices...

    Tuesday, February 12, 2019 12:49 PM
  • Any news for this bug??
    Sunday, April 28, 2019 8:39 AM