Autohotkey, get value from a c++ or javascript class

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
b0bi
Posts: 7
Joined: 07 Apr 2016, 13:11

Autohotkey, get value from a c++ or javascript class

13 Feb 2017, 18:54

Hi !

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 when I am inside chrome browser. With the method I have found, 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 :
https://docs.microsoft.com/en-us/uwp/ap ... properties
I am interested by the "IsEraser" propertie

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

Can anyone help me binding this api with AHK ?

The 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


Thanks for your help :)
4GForce
Posts: 553
Joined: 25 Jan 2017, 03:18
Contact:

Re: Autohotkey, get value from a c++ or javascript class

13 Feb 2017, 19:56

b0bi wrote:With the method I have found, autohotkey only detect a "simple" mouse left click
I don't know what method you're using but if its detected like a simple click, try this and check if the wParam is different when using eraser vs when using tip ...

Code: Select all

#singleinstance force

gui TestGui:new
gui TestGui:show, w500 h500, % "Test gui"

onmessage(0x201, "evClick")

evClick(wParam, lParam, msg, hwnd) {
	; wParam != 1 ????
	msgbox % "wP: " . wParam . "`nlP: " . lParam . "`nmsg: " . msg . "`nhwnd: " . hwnd
	
	; I couldn't figure out how to get the pointerId :(
	; pp := DllCall("GetCurrentPoint", "Uint", pointerId)
	; msgbox % "> " . pp.IsEraser
}
b0bi
Posts: 7
Joined: 07 Apr 2016, 13:11

Re: Autohotkey, get value from a c++ or javascript class

13 Feb 2017, 20:20

4GForce wrote:
b0bi wrote:With the method I have found, autohotkey only detect a "simple" mouse left click
I don't know what method you're using but if its detected like a simple click, try this and check if the wParam is different when using eraser vs when using tip ...

Code: Select all

#singleinstance force

gui TestGui:new
gui TestGui:show, w500 h500, % "Test gui"

onmessage(0x201, "evClick")

evClick(wParam, lParam, msg, hwnd) {
	; wParam != 1 ????
	msgbox % "wP: " . wParam . "`nlP: " . lParam . "`nmsg: " . msg . "`nhwnd: " . hwnd
	
	; I couldn't figure out how to get the pointerId :(
	; pp := DllCall("GetCurrentPoint", "Uint", pointerId)
	; msgbox % "> " . pp.IsEraser
}
thanks for your fast answer but No unfortunately it's the same :\
lexikos
Posts: 9690
Joined: 30 Sep 2013, 04:07
Contact:

Re: Autohotkey, get value from a c++ or javascript class

14 Feb 2017, 01:22

I believe that API is for "Windows Store apps" only, not desktop programs like AutoHotkey.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: mikeyww, peter_ahk, Spawnova and 349 guests