Windows 8 Tablet Swipe Events Not Working. :-(

Has anyone had any success in getting the stock xojo controls to work properly with swipe events on Windows 8? I assumed that swiping up and down on a listbox, for example, would trigger MouseWheel events that scroll the listbox up and down. Sadly, this appears to be broken.

I’ve submitted a feedback case with a video capture of what I’m talking about here:
<https://xojo.com/issue/35236>

If anyone has a windows 8 tablet (that runs the full windows 8, not RT) and would be willing to try the sample project I’ve included with my feedback case, I’d love to know if it works for you or not.

Also, if anyone has a workaround I can try, that would be awesome as well.

Thanks!

Hi Kimball,

Just tried the project on my Surface Pro 8.1 with Xojo 2014 r2.1, and I can confirm that the swipe events are not captured with the program. I’ll try a few things and see if I can create a workaround - no promises though.

Hi Kimball,

I can’t seem to find an easy workaround. MouseDown event fires when tapping the screen. However, I was not able to find an event that triggers when the screen was swiped - tried MouseDrag, MouseMove and neither of them triggered.

Sorry :frowning:

Thanks for the tries @Eugene Dakin - I have put breakpoints in every event in listbox, and none of them fire with the drag. :frowning:

I appreciate the effort though - thanks!

wondering if you install a specific windows message handler what message gets sent for those

Windows Functionality Suite should make that possible

On my Toshiba Encore only the scrollbar moves corresponding the swipe.
If i add the following to your example program:
Mousewheel event:

me.ScrollPosition = me.ListCount me.AddRow str(me.ScrollPosition)

the swipes don’t update the listbox while the scrollwheel does add rows and scrolls to the last row in the listbox.

I do not have a Windows 8 machine with touch so won’t be able to experiment. But in Android, swipe is obtained by tracking the position between mousedown and mouseup. It will not be as easy as if Windows had triggered MouseWheel, but it may allow some workaround…

From the msdn blog, it seems the touch gestures are somewhat different than the regular MouseWheel :
http://blogs.msdn.com/b/windowsappdev/archive/2012/07/02/modernizing-input-in-windows-8.aspx

Since WFS has been created before widespread use of touch, I doubt anything there could help. But here is the description of the Microsoft documentation of the API for handling touch gestures.
http://technet.microsoft.com/en-us/windowsserver/dd353239(v=vs.108).aspx

It does not seem out of reach from Xojo Declare. For instance GetGestureInfo :

BOOL WINAPI GetGestureInfo( _In_ HGESTUREINFO hGestureInfo, _Out_ PGESTUREINFO pGestureInfo );

Could be done catching the WM_TOUCH messages.

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

[quote=127419:@Alain Bailleul]Could be done catching the WM_TOUCH messages.

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

Thank you for mentioning that link. But … How do you get Windows messages in Xojo ?

How would you translate the C## code in there to Xojo ?

By hooking. Something like this maybe? Untested as I don’t have a touch device.

  Declare Function RegisterTouchWindow lib "User32" ( hwnd as integer, flags as Integer) as Integer  
  Declare Function SetWindowsHookExA Lib "User32" ( hookType as Integer, proc as Ptr, instance as Integer, threadID as Integer ) as Integer
  Declare Function GetCurrentThreadId Lib "Kernel32" () as Integer
  
  Const WH_GETMESSAGE = &H3
  
  dim ret as Integer = RegisterTouchWindow(self.Handle, 0)
  
  mHandler = SetWindowsHookExA(WH_GETMESSAGE, AddressOf OnTouch, 0, GetCurrentThreadId)

[code]Protected Function OnTouch(hwnd as integer, Message as integer, wParam as integer, lParam as integer) As integer
Const WM_TOUCH = &h0240

select case Message
case WM_TOUCH

end select
End Function[/code]

Actually I think if you peek in the Windows Functionality Suite they have a window subclass etc that hooks messages already (I forget which ones)

Thanks for all the suggestions so far everyone! I’ve spent the last 20 minutes digging around the WFS, and I can’t find any window subclasses that are hooking like Norman describes, but there is the HooksWFS module there that can be used to install hooks for other things (keyboard, idle, etc).

I fully admit I’m pretty lost when it comes to Windows native stuff … you should see me meandering through the halls of the WFS… feels like the first day of junior high all over again - long hallways of doors and lockers that all look exactly the same to me, because I have no idea what mysteries live inside them yet… :wink:

I grabbed @Alain Bailleul 's code and dropped the first chunk into the open event of my test app window, then added the second chunk (the OnTouch) method to my window. When I first launch the app, the OnTouch method starts getting called immediately (with no touches going on) and keeps getting called ALL_THE_TIME - over and over, even when the app is idle. This may be by design, in which case, YAY! But it may not be, in which case, BOO. At any rate, even though the OnTouch method is being called, the message that it receives is never the WM_TOUCH message. I’m always getting 0xB8FB8C, or 12123020 as an integer. Where do I go look up what this means?

If anyone can provide more details about what I should be chasing down, I’d be grateful.

This article looks promising:
http://technet.microsoft.com/en-us/windowsserver/dd562171(v=vs.108)

Based on my recent reading, I think I just need to disable flicks on my windows to get the legacy scrolling to happen on touch events automagically. But as I mentioned, I’m a bit lost about how exactly one goes about doing so. Any hints / helps / “hey stupid, this is how you do it…” would be great.

Thanks!

[quote=127535:@Kimball Larsen]Thanks for all the suggestions so far everyone! I’ve spent the last 20 minutes digging around the WFS, and I can’t find any window subclasses that are hooking like Norman describes, but there is the HooksWFS module there that can be used to install hooks for other things (keyboard, idle, etc).
[/quote]
I think you’re looking for the code to catch certain windows messages or WND Proc (see WNDprocHelpers I think)

Aaron has some notes about how to use it in Ramblings On REALbasic
And he also mentions window subclassing that WFS makes possible for handling certain messages

Beyond that I’m at a loss
I’m hunting around to see if I have one of his other articles that might help

EDIT : found it
http://web.archive.org/web/20070301083256/http://www.aaronballman.com/programming/REALbasic/WindowSubclassingArticle.php

Thanks, Norman. I have not had any time to revisit this issue since the weekend, but we do have some plans to bring some of our products to windows tables that run the full versions of Windows 8 with touch interfaces. Is there any chance at all that this issue will get looked at within the next 6 months?

I’ll likely have to develop my own solution that involves hooks, but we are at least 6 months away from having this issue affect our product line. If there is a chance Xojo will be addressing this, then I can hold off on my own (probably crappy) solution.

As a side question: has anyone else had much of any demand for touch-interface enabled windows apps on the latest windows 8 tablets? Am I really the first one to notice this issue and report it?

The users I am in constant contact with absolutely love touch-interface apps. Once the graphics speed increase, and touch-interface is enabled then there will be many Xojo programs created. Until now I have had to use an alternative tool to create programs with this functionality.

Crossing my fingers for 64 bit Xojo!

This case 35236 was merged into case 35178 yesterday. Status marked as fixed on 3 Sep.

Actually the symptom can be experienced on the Xojo IDE itself - Library and Inspector on the right. Don’t know whether this means the IDE is also fixed or not. It is a bit of pain using Xojo on my Vaio Duo 13. Every time I need to scroll I have to use 2 fingers on the touchpad. But then the Duo 13 is like a convertible. Tablet only obviously do not have touchpad.

Hey, that’s pretty fantastic! I can’t wait to see a build with this fix incorporated!