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.
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.
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.
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…
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
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…
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.
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.
[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
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.
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.