Changing touch event source on Mobile Safari - mobile-safari

I have two overlapping images. I touch the topmost image and start moving (touchmove) finger around. All subsequent touchmove events are received by that image. In the middle of this interaction I want the events to go to the image underneath, so that I can move it around instead.
How to change the event source to the image underneath? That is, once an object has started receiving touch events, how do I change the target of those events?

I suspect that Joe Blow is talking about handling touch events in the context of a native iPhone app built with Objective-C.
Eric's question is about handling touch events in Mobile Safari with JavaScript.
I could be confused though...

Related

Getting a custom UIView to respond to a two finger trackpad scroll gesture (or mouse scroll wheel)

I have an iPad app (in C#) with a custom UIView that allows input via touch and Apple Pencil stylus touches. I am trying to integrate support for trackpad/mouse indirect (cursor, or "pointer" as Apple calls it).
I got hover working using HoverGestureRecognizer. I got right-click and control-click working using normal touch Began/Moved/Ended/Cancelled events and checking for .type == .indirectPointer and then checking if the control key modifier in event.ModifierFlags is set, or if event.ButtonMask == secondary.
I have spent a lot of time searching through the documentation on the Apple Developer website, starting here and branching out:
UIApplicationSupportsIndirectInputEvents
Somehow I cannot find the API that the system calls in my code when a two-finger trackpad scroll (or mouse scrollwheel scroll) occurs. (On another view that is a scrollview, I can get the scrollview's scroll event when I do a two-finger scroll, since this is built-in to iPadOS 13.4+ for scroll views, but my custom view is not a scroll view, it just has some scrollable areas inside of it.)
Things I tried:
UISwipeGestureRecognizer. Nothing was called for two-finger trackpad scroll gesture.
UIPanGestureRecognizer. Nothing.
Subclassing UIScrollView and adding a UIScrollViewDelegate, just to see if it would work... Nothing.
Subclassing GestureRecognizer and adding that, then overriding ShouldReceive(UIEvent evt) but that was never called.
What does iPadOS 13.4+ convert the trackpad two-finger scroll gesture into? Can I get this as some sort of event? The documentation linked above is pretty disappointingly barebones, but it mentions UIEvent.EventType.scroll but not how or when or where the system will call any of my methods with an event of that type. Pretty infuriating. They should just spell this out more clearly.
Answers in Swift or C# are welcomed.
OK, strangely I thought I tried PanGestureRecognizer, but I must have set it up wrong. The example code project by Apple, Integrating Pointer Interactions into Your iPad App had the answer (C# code):
panRecognizer = new UIPanGestureRecognizer(() => {
Console.WriteLine("panned -- " + panRecognizer.VelocityInView(this));
});
panRecognizer.AllowedScrollTypesMask = UIScrollTypeMask.Continuous;
AddGestureRecognizer(panRecognizer);
Glad I figured this out!

Are there any JavaScript events being fired when swiping on the WebView with Talkback (screen reader) is on?

I have an Android app that hosts an WebView and we want to adopt some accessibility feature on it.
Short question:
Are there any talkback events on the JavaScript side being fired when user swipe left or right on the WebView?
Details:
On the WebView I have a carousel component displaying some images. I want to do some specific actions, in the accessibility mode, when users do a single-fingle-swipe left or right (in this case, a single-fingle-swipe means going to next / previous available element). So in this way, if there are any events being fired that I can catch, it would be great.
Edited the question with a image that explains in details.
Thanks!

iOS 5.1 swipe gesture hijacked by UISplitViewController - how to avoid?

A new behavior in iOS 5.1 related to UISplitViewController apps seems to be intercepting UISlider motion with undesired results. This might also apply to UISegmented Controls and any other control surface that handles left-to-right gestures.
With a UISplitView in Portrait orientation, the Master view is normally hidden. Starting in iOS 5.1 a right swipe on screen brings up the Master View on the left side of the device. The problem is, sliding the thumb of my UISlider control is misinterpreted as a screen swipe: if I give the UISlider thumb a sharp push to the right, the Master panel pops up.
In my app, there are undesired side-effects (and performance issues) with brining up the Master view.
I consider this behavior an Apple bug. Any ideas how to work around it? Can I somehow have the UISlider capture the gesture and process it, without passing it up the responder chain?
Thanks in advance for any insight!
Apple confirmed the issue as a duplicate of a previously reported bug that is currently under investigation (Bug ID# 10170209).
The workaround seems to be functioning fine for now.

Gesture Events and StageWebView

Greetings! I have a Flex 4.5 Mobile project rolling, and I've hit a pretty crazy snag. I'm using a StageWebView object to render web pages, embedded within the rest of my spark layouts. I'm trying to add a gesture event to the component that contains the StageWebView, but since the StageWebView object doesn't belong to the Flex stack (it inherits from EventDispatcher, not UIComponent) all of my events seem to be getting eaten. Any mouse based event (click, gesture, etc) doesn't seem to register, and I'm not sure how to get around it. The gesture events work if I use the area where the browser is not rendered. How can I get the gesture event from the outer SkinnableContainer?
StageWebView Reference:
http://help.adobe.com/en_US/FlashPlatform/beta/reference/actionscript/3/flash/media/StageWebView.html
UIComponent Wrapped StageWebView:
http://soenkerohde.com/2010/11/air-mobile-stagewebview-uicomponent/
Thanks!
I guess you might have to wire up the gesture events yourself, just doing a quick digging in UIComponent.as, it has these:
[Event(name="touchInteractionStarting", type="mx.events.TouchInteractionEvent")]
[Event(name="touchInteractionStart", type="mx.events.TouchInteractionEvent")]
[Event(name="touchInteractionEnd", type="mx.events.TouchInteractionEvent")]
it's not a bug, from what i understand any mouse interaction over a stagewebview means an interaction with the html currently loaded in itself. you should capture events there and trigger it back to the swf.
surely there are some jquery plugins or something that have gestures to help achieving that.
it's a bit of a bummer that you cant overlay stuff over them though.

Flex Air RollOver on inactive Native Window

I have a Native Window in Flex AIR. Let's say the window doesn't have a focus. It is inactive. Is it possible to find out when mouse is over such window? The window is always in front. I heard that it is possible by checking stage.mouseX in ENTER FRAME handler. But maybe there is a more elegant solution ?
I would look into using the MouseEvent.MOUSE_OVER event; which I would expect to fire whenever the mouse enters the window.
The only issue I see is that the NaiveWindow class does not document mouse events. So, the mouse event will most likely have to be dispatched from one of the children of the NativeWindow. You may try adding a a transparent image as the background, or something similar, and listen for the event on that image.
Not sure what you mean by you have a NativeWindow, but if you've extended spark.components.Window (which is the way you should be creating a window) and add a MouseEvent.MOUSE_MOVE listener to it then that will be triggered whenever the mouse is moving over the window, regardless of whether or not the window or application itself has focus.

Resources