global multi finger touch gestures in Win 8 with TouchMe

Discuss other useful utilities, general computing tips & tricks, Internet resources, etc.
drabne
Posts: 22
Joined: 17 Feb 2014, 02:26

global multi finger touch gestures in Win 8 with TouchMe

07 Oct 2014, 13:26

I earlier requested built in multi finger touch gestures for AutoHotkey.

I have since then discovered the third party tool TouchMe, a free Windows store app GUI for gesture setup and a 30 day trial commercial "engine" that does the underlying work. TouchMe supports 2 to 5 finger input with gestures like swipe left/right/up/down, pinch in, pinch out and rotate fingers. Some useful commands are built in. But the best part is that the TouchMe GUI can make a gesture send any chosen keyboard combination. Those keys are detected by AutoHotkey which mean that touch gestures can be used as trigger for anything AutoHotkey can do. For example set the gesture three finger right swipe to send the keys ctrl+alt+F8 and set ctrl+alt+F8 as hotkey in autohotkey.

The TouchMe developer posted in the old forum with no replies.

The TouchMe Windows store app
http://apps.microsoft.com/windows/en-us ... 3782cb7607
The trial gesture engine software (also downloadable within the app)
http://www.yasharbahman.com/TouchMe/InstallMe.exe

I wish there was a more direct way to set up the touch gestures in AutoHotkey without the extra step with the TouchMe GUI settings. Maybe some smart person here can examine the touch engine and see if there is a way to use it directly. Best case scenario is if local and global custom gestures can be set up like this made up code
#IfWinActive, ahk_exe vlc.exe
3FingerSwipeRight:: msgbox, hello world!
#IfWinActive
User avatar
joedf
Posts: 8959
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: global multi finger touch gestures in Win 8 with TouchMe

07 Oct 2014, 14:22

~~topic moved to "Ask For Help"~~
maybe sending keys custom wierd keys like Ctrl+Shift+Alt+F7??
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
drabne
Posts: 22
Joined: 17 Feb 2014, 02:26

Re: global multi finger touch gestures in Win 8 with TouchMe

08 Oct 2014, 10:45

joedf wrote:~~topic moved to "Ask For Help"~~
Well I both posted information about "working scripts, libraries and tools" and then tagged on a request so I guess either subforum fits.
joedf wrote:maybe sending keys custom wierd keys like Ctrl+Shift+Alt+F7??
That already works. But you have to first set up the gesture-to-hotkey in TouchMe GUI and then the hotkey-to-action in AHK. I tried editing the TouchMe settings file (in xml format) manually the changes there didn't appear to stick. But maybe that is doable after all. In that case some AHK script could be made that automates the gesture-to-hotkey for all supported gestures by writing to the xml.

update
I posted a request to the TouchMe developer and he replied "If the AHK dev is onboard with making this happen, i’d be ecstatic to work together to pull something off."
User avatar
joedf
Posts: 8959
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: global multi finger touch gestures in Win 8 with TouchMe

08 Oct 2014, 11:05

Ur right my mistake :P
~~Shadow topic in ask for help~~

Ok, where Is the XML located? I'll try it in virtualbox since I don't have win8 installed

Update: ok, cool. About the legal stuff, there's nothing against an API? I'm thing how about using Window Messages, an ahk script could send its Hwnd to TouchMe...?
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
ybahman22

Re: global multi finger touch gestures in Win 8 with TouchMe

10 Oct 2014, 02:28

There're two ways I can think of this working, experience wise.

1. Users configure touch gestures to trigger actions via an .ahk script (this seems to be what OP is looking for)
2. Users configure touch gestures to trigger actions via the TouchMe Gesture Studio app

The challenge is maintaining the codependency between the two apps. I wouldn't want users to have issues and think somethings broken, just because they don't know there's another step to the installation.

Thoughts?
drabne
Posts: 22
Joined: 17 Feb 2014, 02:26

Re: global multi finger touch gestures in Win 8 with TouchMe

10 Oct 2014, 07:11

ybahman22 wrote: 1. Users configure touch gestures to trigger actions via an .ahk script (this seems to be what OP is looking for)
Yes. But more generally I'm for anything that makes it simpler to setup TouchMe gestures to trigger AHK actions.
In the best case the touch gesture actions would for the AHK script writer be set up just like keyboard and mouse hotkeys are set up today. Mock up example "3TouchPinch:: msgbox, hello world". But on reflection I guess that would require an update to AHK itself. But I'm not knowledgeable enough on this stuff to say. I guess this is where Lexikos and other developers would have to weigh in.

If TouchMe could work with the OnMessage type code in joedf's link then a template script for that with a set of default labels could be made. The user would then set up actions under "3TouchPinch:" type labels instead.

The lowest hanging fruit right now may be to simplify setting up all TouchMe gestures for AHK use in the TouchMe settings without the GUI. I tried editing the TouchMe .xml directly but that didn't seem to "stick". Can you confirm that that should work and if so if a special procedure must be followed. Must the TouchMe app be closed/open? I found two touchme .xml files in different folders (don't remember exact path, I don't have that computer here ATM), can either one be edited? There is in your support forum mention of a TouchMe setting for executing a program directly but I didn't get that to work either (I've only done a quick test I should say, may be user failure). Can you confirm that the execute setting is working?

If the .xml editing mentioned in the preceeding paragraph can be made to work then we could
1. set up TouchMe with exotic, noncolliding hotkeys (like ctrl+shift+win+F11) for all the gestures, keep a list of the gesture-to-hotkey in some textfile and the use the list as reference to set up hotkey-to-actions in AHK scripts.
2. set up TouchMe to execture a separate .ahk file for each gesture, Create those AHK files as blanks, edit and then set up actions in those AHK file you want touch actions for.
3. set up TouchMe to execture a single .ahk file but with different command line parameters. That .ahk would in turn run other AHK scripts based on the command line parameters. This may be tricky however if we want to use touch input for some script that has to keep running without restart.

One thing missing from 1-3 is easy access to touch locations. It would be very useful to be able to make AHK do different actions based on where on the screen the touch input takes place. For example a simple use of that would be to touch and hold one finger in the left corner and then touch another finger in either of four screen segments (upper left, upper right, lower right, lower left) to trigger four different actions. If we have touch screen locations (especially that of first finger touched) we can also localize touch gestures to whatever control in whatever window the touch gestures was over. A touch gesture over a toolbar could trigger a different action than a gesture over the main view.

If the execute method does work then locations could be given if TouchMe added a special variable, for use in TouchMe settings, that sends touch screen coordinates over the command line. Mock up example: "C:\3TouchPinch.ahk $locations". But for the touch-to-hotkey method TouchMe would need to expose the touch location data in some other way.
ybahman22

Re: global multi finger touch gestures in Win 8 with TouchMe

27 Oct 2014, 10:47

As long as TouchMe Engine is running, manually editing/saving the correct gesture file will cause the engine to ingest the new settings. However, it's hard to know which gesture file the TouchMe Engine is using. It's usually found at "C:\Users\<YourUsername/>\AppData\Local\Packages\47445Rumor.TouchMeGestureStudio_qzbdzynm6aght\LocalState\TouchMeSettings.xml"


More importantly though, TouchMe has a complicated licensing story, so it's not easy to take a dependency on it. Especially since AHK can't determine the state of the TouchMe license. From a usability design standpoint, this is a crippling shortcoming since there can be a great number of reasons why an AHK script may fail if it's trying to rely on TouchMe, but noway for the user to understand what's going on.

Since AHK has no licensing story, it's a better design for TouchMe to take a dependency on AHK instead.

For example, during TouchMe installation, an AHK DLL will also be installed into the TouchMe directory: http://www.autohotkey.net/~HotKeyIt/Aut ... l-txt.html

The user experience would be as follows:
1. User Opens TouchMe Gesture Studio
2. User chooses a gesture
3. User chooses the action "AHK Script"
4. A textbox is provided
5. User can then type in their desired AHK script directly into the TMGS UI
User avatar
joedf
Posts: 8959
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: global multi finger touch gestures in Win 8 with TouchMe

27 Oct 2014, 12:35

That would be cool to intergrate ahk in there. ;)
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
ybahman22

Re: global multi finger touch gestures in Win 8 with TouchMe

28 Oct 2014, 22:59

This is where the legal part comes into play. The AHk DLL is released under a license which makes it impossible to sell a product that relies on it :(
User avatar
joedf
Posts: 8959
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: global multi finger touch gestures in Win 8 with TouchMe

29 Oct 2014, 02:18

As i remember.. there's quite a bit of confusion with GPL... I still am :P
But if i remember correctly, GPL v2 does not prohibit the software's inclusion in commercial (to be sold) software.
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
ybahman22

Re: global multi finger touch gestures in Win 8 with TouchMe

29 Oct 2014, 17:57

ah you're right. The problem wasn't making a profit, it was distributing it in a closed source application.

https://tldrlegal.com/license/gnu-gener ... license-v2

And unfortunately, open sourcing TouchMe would basically end all the future plans we have for the software.

It's a little fuzzy on whether or not the closed-source requirement applied to applications that didn't modify the source at all, but I suspect it does. But maybe there's something I'm misunderstanding?
User avatar
joedf
Posts: 8959
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: global multi finger touch gestures in Win 8 with TouchMe

29 Oct 2014, 18:34

Ahhh I see... That's a problemo! thats why a lot of people dont really like GPL...
I think this can be worked around.. ...
After some searching.... took awhile... But I knew it..
Here's the catch! : Basically, youll have your application communicate with a separate OPEN-Source Program that will need to created, which that program will communicate with the AHK DLL. then make the AHK thingy Optional.
Diagram: TouchMe (closed source) --> New Program (open source) --> AutoHotkey.dll
see here: http://stackoverflow.com/a/8849874/883015

Basically GPL likes to control how you distribute, Not how you use the gpl software...
See here: http://quoderat.megginson.com/2009/06/1 ... rspective/
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
drabne
Posts: 22
Joined: 17 Feb 2014, 02:26

Re: global multi finger touch gestures in Win 8 with TouchMe

02 Nov 2014, 16:38

ybahman22 wrote: AHK DLL ... installed into the TouchMe directory ...
1. User Opens TouchMe Gesture Studio
2. User chooses a gesture
3. User chooses the action "AHK Script"
4. A textbox is provided
5. User can then type in their desired AHK script directly into the TMGS UI
Do you mean the yser would type their ahk code into the textbox (not type a command line path to an .ahk file)? I don't like that idea I must say. think that would get messy fast. I wouldn't want to replace Notepad++ or any such editor with a textbox in the TouchMe UI. To avoid that users would for each ahk code modification have to go inside the UI, select the current script, paste and edit in a text editor (with syntax highlight, command suggestion, and other helpful features coding text editors have) and then paste it back into TouchMe UI and save. Clunky!

I respectfully hope you go for one of the other possibilities I sketched upthread. For example add an "execute path" action in TouchMe UI and let users paste paths to one individual .ahk file (or whatever they want to execute). In addition to that make TouchMe provide data on the finger positioning and movements for a detected gesture in a way that AHK can access. For example in a hidden GUI window with controls that AHK can read with ControlGetText and get start, stop and some intermediate coordinates plus timestamps for each finger, in the order of when each finger first touched the screen.

Return to “Other Utilities & Resources”

Who is online

Users browsing this forum: No registered users and 39 guests