Jump to content
LawrenceDon

[demo] How to handle WM_GESTURE and WM_TOUCH message:)

Recommended Posts

LawrenceDon

When I get an ultrabook with multi-touch panel, the idea that using autoit to handle the multi-touch message comes out.

Simple enough, but it can work normally. Enjoy it:)

Posted Image

Posted Image

Posted Image

Files in attachment:

MT_GESTURE.au3 WM_GESTURE.jpg

MT_TOUCH.au3 WM_TOUCH.jpg

MT_TOUCH _Color_Point_V2.au3 WM_TOUCH_V2.jpg

Reference:

WM_TOUCH message

http://msdn.microsoft.com/en-us/library/windows/desktop/dd317341(v=vs.85).aspx

WM_GESTURE message

http://msdn.microsoft.com/en-us/library/windows/desktop/dd353242(v=vs.85).aspx

GESTURE_TOUCH.zip

Edited by LawrenceDon
  • Like 2

Share this post


Link to post
Share on other sites
spudw2k
guinness

I'm the same. I would love to know if this works.


UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites
veronesi

They work, but only when you touch with your finger.

If you try the MT_TOUCH example with a pen or the mouse, it will not work.

But I think, this will be an other Event.

Very good example!

Veronesi

Share this post


Link to post
Share on other sites
LawrenceDon

Yes, you're right, and you can refer to the link below to get more information about Windows Touch.

Getting Started with Windows Touch Messages

http://msdn.microsoft.com/en-us/library/windows/desktop/dd371581(v=vs.85).aspx

They work, but only when you touch with your finger.

If you try the MT_TOUCH example with a pen or the mouse, it will not work.

But I think, this will be an other Event.

Very good example!

Veronesi

Share this post


Link to post
Share on other sites
GtaSpider

Hey,

very nice example. I just palyed a little bit with the WM_GESTURE function and made a little Multitouch Zoom In/Out test (nothing special, but you can see something happen here)

Here is a video:

Greetz,

Spider

MT_GESTURE_ZoomInOut.au3

Edited by GtaSpider

www.AutoIt.de - Moderator of the German AutoIt Froum

Share this post


Link to post
Share on other sites
baboink

Great script. Almost exactly what I'm looking for except that I need to capture touch events outside of the application. My goal is to create metrics to determine how often the touch interface is used on a touch device. Any help would be appreciated.

Share this post


Link to post
Share on other sites
Leo1906

Why does'nt WM_TOUCH get fired when you touch on a control?

For example add a Button like this to the GUI in MT_TOUCH.au3:

GUICtrlCreateButton("Button1", 600, 400, 80, 25)

When you touch the plain GUI the WM_TOUCH get's executed, when you touch the button it won't.

Is there a way around this? How can you differentiate between a touch click or a mouse click on a control?

Share this post


Link to post
Share on other sites
TJF

You can fire the touch "normally"...

$test = GUICtrlCreateButton("Button1", 600, 400, 80, 25)
...
Case $test
...

But I wonder, if there is a way to get something like $GUI_EVENT_PRIMARYDOWN to work...? I want to use a button as pushbutton - button stays only pressed (with mouse-event $GUI_EVENT_PRIMARYDOWN works fine)...?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×