3

I have a Microsoft surface with a surface pen. This pen has 2 side : eraser and tip.

I want authotkey to detect when I touch the "eraser" side of the pen when I am inside chrome browser.

With the method I have found yet, autohotkey only detect a "simple" mouse left click (for the moment it doesn't support the surface pen).

(please note that I DO NOT want to rebind the eraser button, but the eraser "touch" on screen).

Here is the microsoft api for detecting eraser screen touch :

I am interested by the IsEraser propertie

The api is available in : c++, c#, VB, javascript and VB

My final goal is: when AHK detect a "standard" left click, it calls the microsoft api to check is the click is in fact "eraser side", if yes, it trigger my task

Can anyone help me binding this api with AHK ?

n0tis
  • 750
  • 1
  • 6
  • 27
  • AHK does not officially support 'touch' events. However, you may use a third party app such as [TouchMe](https://autohotkey.com/boards/viewtopic.php?f=22&t=4809) in combination. Otherwise, you may have to implement your own "touch detector" AHK interface. – Joe DF Feb 14 '17 at 04:19

1 Answers1

1

Using Lexikos' CLR library, you can interface with C# code from within AHK.
You can even store c# code as a string inside an AHK script, then compile it and instantiate a class from the C# code from within an AHK script.

Clive Galway
  • 482
  • 4
  • 13