Touch screen and AHK – an old issue ...

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
newbieforever
Posts: 506
Joined: 24 Aug 2016, 03:34

Touch screen and AHK – an old issue ...

Post by newbieforever » 03 Apr 2023, 06:00

I know, this is an old issue.

Maybe this script demonstrates the main problem (i.e. the difference between click and touch):

Code: Select all

LButton::
t := A_TickCount
KeyWait LButton
t := A_TickCount - t
ToolTip Time = %t%
Return
First difference:
I suppose, Time is the between down and up of the click or touch.
On my computer Time for the left mouse click is typically > 170 ms, for the touch always 0.

Second difference:
The touch is not blocked by the above hotkey, it has its normal effect, in contrary to the click.
Which seems to be the main problem for AHK ...

Any new ideas?
Last edited by newbieforever on 03 Apr 2023, 07:39, edited 1 time in total.
User avatar
mikeyww
Posts: 27366
Joined: 09 Sep 2014, 18:38

Re: Touch screen and AHK – an old issue ...

Post by mikeyww » 03 Apr 2023, 06:14

Perhaps you have already seen these posts, but just in case....

viewtopic.php?t=60790

viewtopic.php?t=22450

I don't know if this solves it, but they could be leads.
newbieforever
Posts: 506
Joined: 24 Aug 2016, 03:34

Re: Touch screen and AHK – an old issue ...

Post by newbieforever » 03 Apr 2023, 07:48

As far as I can see, no one here has yet found a solution to customize the script above to block the touch (as is the case with the click).
But without such a solution no touch remapping is possible ...
newbieforever
Posts: 506
Joined: 24 Aug 2016, 03:34

Re: Touch screen and AHK – an old issue ...

Post by newbieforever » 04 Apr 2023, 00:03

newbieforever wrote:
03 Apr 2023, 07:48
As far as I can see, no one here has yet found a solution to customize the script above to block the touch (as is the case with the click).
But without such a solution no touch remapping is possible ...
And there are already so many touchscreen computers (or their users) that there would be a real need for a solution. Couldn't an AHK professional devote himself to this problem? :)
User avatar
mikeyww
Posts: 27366
Joined: 09 Sep 2014, 18:38

Re: Touch screen and AHK – an old issue ...

Post by mikeyww » 04 Apr 2023, 05:53

Yes. I think that's you. Please post the solution when ready! :)
newbieforever
Posts: 506
Joined: 24 Aug 2016, 03:34

Re: Touch screen and AHK – an old issue ...

Post by newbieforever » 04 Apr 2023, 07:02

mikeyww wrote:
04 Apr 2023, 05:53
Yes. I think that's you. Please post the solution when ready! :)
That makes me laugh!

But: A tip for real professionals, maybe they grab the ambition:
The solution could lie in it:
MSLLHOOKSTRUCT & dwExtraInfo
dwExtraInfo should provide info about touch events.

; MSLLHOOKSTRUCT dwExtraInfo autohotkey
; MSLLHOOKSTRUCT dwExtraInfo !"touch event"
; https://stackoverflow.com/questions/62180923/capture-touch-input-on-the-screen-in-windows-device
; viewtopic.php?t=9247
; viewtopic.php?t=6392
; https://stackoverflow.com/questions/45473673/how-to-distinguish-touch-vs-mouse-event-from-setwindowshookex-in-c-sharp
; https://stackoverflow.com/questions/50407901/capturing-touch-events-with-lowlevelmouseproc-does-not-work-for-all-applications

So everything would be contained here somewhere, you would only have to tinker it together! :lol:
Post Reply

Return to “Ask for Help (v1)”