Is there a way to determine if the pen is next to the screen in WinRT

I want to find out if I have a pen next to the screen or not.
For example, I would like to show a different application panel if I open it with a pen.
I would also like to show other things on the screen when I hold the pen next to it (without necessarily touching it).

/Jimmy

+4
source share
2 answers

When the pen or finger is near the screen, you will receive a PointerEntered event. The PointerPressed event fires when a pen or finger PointerPressed contact. If the hardware does not support proximity, then PointerEntered does not work until a contact is made and it immediately follows PointerPressed .

+5
source

I get it.
I listen to the PointerEntered event and the PointerExited event, and then sets a variable that I can check in appbar_opened-event.
It works great.

/Jimmy

+1
source

All Articles