Reputation: 21
I'm working at a company which develops an application which can be used for drawing with multiple touch inputs at once. The problem is, when you swipe with three or four fingers upward or downward, the built-in Windows touch gestures activates, and the desktop shows up, for example.
Is there a way to somehow disable these system-wide gestures while the app is running?
I cannot modify the Registry, because if the app crashes or something unexpected happens, the power goes off for example, the Registry modifications won't revert.
Upvotes: 0
Views: 164
Reputation: 596582
Per Microsoft's documentation:
Detecting and Tracking Multiple Touch Points
Important
Windows 11 and newer
Some three- and four-finger touch interactions will no longer work in Windows apps by default.
By default, three- and four-finger touch interactions are now consumed by the system for operations such as switching or minimizing windows and changing virtual desktops. As these interactions are now handled at the system level, your app's functionality could be affected by this change.
To support three- or four-finger interactions within an application, a new user setting has been introduced that specifies whether or not the system handles these interactions:
Bluetooth & devices > Touch > "Three- and four-finger touch gestures"
When set to "On" (default), the system will handle all three- and four-finger interactions (apps will not be able to support them).
When set to "Off", three- and four-finger interactions can be supported by apps (they will not be handled by the system).
If your application must support these interactions, we recommend that you inform users of this setting and provide a link that launches the Settings app to the relevant page (ms-settings:devices-touch). For more details, see Launcher.LaunchUriAsync Method.
IOW, Microsoft does not provide an API to handle this within your app itself. The user must turn off the system setting on your app's behalf.
Or, you will just have to modify the Registry directly. In which case, I would suggest creating a backup of the original setting, and then make a separate watchdog process/service that can restore the backup if your main app crashes or the OS is rebooted.
Upvotes: 1