0

I am developing a UWP App.

We link different behaviors for the different mouse buttons (left, right, middle) and I would like to link also some handlers for the extended buttons (e.g. when we detect a click with PointerUpdateKind.XButton2Pressed).

For the extended buttons, I would like to read the behavior specified by the user and apply the same (e.g. if the user set a default behavior for the extended button 1 via XMouseButtonControl (https://www.highrez.co.uk/downloads/XMouseButtonControl.htm), as the "Copy" action, like CTRL+C, I would like to copy the selected content on the app when the user click on Extended button 1 on our app).

How can I programmatically read such behavior specified by the user within an UWP app? Is there an UWP API that I can use?

Cristiano Ghersi
  • 1,944
  • 1
  • 20
  • 46

1 Answers1

0

Because the function is provided by the application, so when the extended key is pressed, the specific what to do is by the application.

If you want the user to specify the function of the extended key, you can record the user's personalized settings in the ApplicationData.LocalSettings.

When the XButton is pressed, the corresponding function is enabled according to the current user settings.

Thanks.

Richard Zhang
  • 7,523
  • 1
  • 7
  • 13
  • Thank you for the proposal, but it is not exactly what I want. In this scenario, the user assigns a specific behavior to the extended button in the interface of the mouse provider. This behavior is then replicated across all the applications, so the applications should be able to fetch this setting (and not ask again to the user to re-set the same settings for each single app). Should I look into the Registry, or is there an API from UWP that allow me to access this information (that has already been saved by the GUI of the mouse provider)? – Cristiano Ghersi Jun 23 '20 at 17:34
  • Hello, UWP applications are sandboxed applications and cannot provide related APIs for registry access. At the same time, the UWP application cannot interfere with other applications, and the function definition of XButton is only used for the application itself – Richard Zhang Jun 23 '20 at 23:53