Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separating Mouse Cursor movement when touch operation is performed on WPF application #10191

Open
vsfeedback opened this issue Dec 18, 2024 · 0 comments
Labels
Question General question, not a problem in source code or documentation (yet)

Comments

@vsfeedback
Copy link

This issue has been moved from a ticket on Developer Community.


[severity:It bothers me. A fix would be nice]

MainWindow.xaml

MainWindow.xaml.cs
We would like to seek a technical help on simulating the behavior of virtual touch pad in our application on windows 10.
Following are the details based on the analysis done so far.

Problem Statement:

  • When touch operations are performed on a WPF application, the mouse cursor/pointer moves to the same location where first touch is done.
  • Mouse cursor/pointer is not visible

Expected output:

  • The mouse cursor/pointer should move on desktop when user performs touch and drag operation on an application
  • We don’t want mouse cursor/pointer to move its position when touch operation is performed

Sample application details:

  • Application type : WPF app
  • Canvas is added on window to capture touch events.
  • Dot Net Framework : 4.8
    Note: The sample XAML and Code behind is attached to this message

Analysis done so far:
The following option were tried, but we couldn’t get the mouse cursor separated from touch operations:

  1. Using hooks to filter the low-level mouse events
    - API name: SetWindowsHookEx
    a. The hook is applied to capture the Low-level mouse input events using Hook procedure for WH_MOUSE_LL = 14;
    • In call back function check as below:
      a. If touch is active and if mouse event is received then filter out the mouse events
      private static IntPtr MouseHookCallback(int nCode, IntPtr wParam, IntPtr lParam)
  2. Mouse cursor/pointer movement
    • It is observed that when touch is performed the cursor/pointers is not visible
    • We tried to set the visibility with Native Win32 API; s but couldn't get the cursor visible

Query:
We would like to seek help to get the mouse cursor/pointer movement and visibility on screen and controlled by touch operations from custom application in WPF


Original Comments

Feedback Bot on 11/27/2024, 07:25 AM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

U_1405585 on 12/4/2024, 03:10 PM:

(private comment, text removed)

@himgoyalmicro himgoyalmicro added the Question General question, not a problem in source code or documentation (yet) label Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question General question, not a problem in source code or documentation (yet)
Projects
None yet
Development

No branches or pull requests

2 participants