Separating Mouse Cursor movement when touch operation is performed on WPF application
- Dominant language
- C#
- Stars
- 7.7k
- Forks
- 1.3k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 61
Description
_This issue has been moved from [a ticket on Developer Community](https://developercommunity.visualstudio.com/t/Separating-Mouse-Cursor-movement-when-to/10799886)._
---
[severity:It bothers me. A fix would be nice]
[MainWindow.xaml](https://aka.ms/dc/file?name=B5b2de958b07e4db584ab44e45f2ec491638682164542109995_MainWindow.xaml&tid=5b2de958b07e4db584ab44e45f2ec491638682164542109995)
[MainWindow.xaml.cs](https://aka.ms/dc/file?name=B4a659f569b31444da6de69bd462ec651638682164918512598_MainWindow.xaml.cs&tid=4a659f569b31444da6de69bd462ec651638682164918512598)
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)
Contributor guide
Assessment
This issue has not been assessed yet.