1

I am developing an app in UWP for Windows 10.

I would like to perform some action when the user presses a button on the Pen (e.g. eraser or barrel button).

Ideally, I would like to have an app-wide listener that is fired when the user presses e.g. the eraser button, even when the pen is "far" from the screen (e.g. 30 cm / 1 foot distance between the pen and the screen).

Is there any way to achieve this in UWP / C#?

Thanks!

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

2 Answers2

0

You could check the PenButtonListener Class which is newly added in the build 19041.

Roy Li - MSFT
  • 8,043
  • 1
  • 7
  • 13
  • I tried, but it is not working. It intermittently doesn't sense the click on the barrel button. Moreover, it works only for the Surface PC series. Have you tried it too? – Cristiano Ghersi Aug 18 '20 at 15:54
0

On latest windows 10, Windows.Devices.Input.PenButtonListener was added for this.

Giovanni Esposito
  • 10,696
  • 1
  • 14
  • 30
Fei Su
  • 1
  • I tried, but it is not working. It intermittently doesn't sense the click on the barrel button. Moreover, it works only for the Surface PC series. Have you tried it too? – Cristiano Ghersi Aug 18 '20 at 15:54