Simulate touching two controls at once

Is there are way in the iOS Simulator to emulate touching TWO controls at the same time?
I have two buttons, and pressing “A” does one thing, pressing “B” does another, and pressing “A” and “B” does a third.

It works on a real device of course, but I’d like to test things without resorting to doing that for now

Holding the option key should allow two simultaneous touches.

Ahem… No Option key on an iOS device :smiley:

He said “iOS Simulator”

Dave is asking about the iOS Simulator which runs under macOS where there is an Option key.

But I don’t think the Option key will do what Dave wants either. Or at least I don’t know how. It is used to simulate pinch and zoom gestures, but as far as I know you can’t directly control where the second touch point occurs. The Option key just makes two gray circles appear and you drag towards or away from each other to simulate pinch/zoom.

In the Simulator help file all I can find is;

[quote]User testing should be done on physical devices when real world results are required.

User interaction with a pointer and keyboard is different from using fingers on iOS and watchOS, or from the focus based model used on tvOS.[/quote]

And this cheat sheet from iOS 6 days:

[quote][code]Gestures in the Simulator

Gesture iPad Action

Tap Click the mouse.

Touch and hold Hold down the mouse button.

Double tap Double-click the mouse button.

Two-finger tap 1. Move the mouse pointer over the place where you want to
start.
2. Hold down the Option key, which makes two circles appear that
stand in for your fingers.
3. Click the mouse button.

Swipe 1. Click where you want to start and hold down the mouse
button.
2. Move the mouse slowly in the direction of the swipe and then
release the mouse button.

Flick 1. Click where you want to start and hold the mouse button
down.
2. Move the mouse quickly in the direction of the flick and then
release the mouse button.

Drag 1. Click where you want to start and hold down the mouse
button.
2. Move the mouse slowly in the drag direction.

Pinch 1. Move the mouse pointer over the place where you want to
start.
2. Hold down the Option key, which makes two circles appear that
stand in for your fingers.
3. Hold down the mouse button and move the circles in (to pinch) or
out (to unpinch).
[/code][/quote]

There is simply no way to “punch” two keys at the same time on the virtual keyboard of an iOS device.

Whatever you want to do, this calls for refactoring.

no, not in this case…

Its a Timer… one increments Minutes, one increments Seconds, pushing both Resets to Zero.
Works perfect on a real device… Due to the graphic and design there is no place for more buttons

and so there is no confusion… its not the “virtual keyboard”… its two “button” controls…

I don’t think Dave meant “A” and “B” were letters on the virtual keyboard – I think they were example titles of (push) buttons.

And to my knowledge, you can’t simulate proper multi-touch on the simulator – merely pinch and zoom using the Option key. That said, most iOS apps only act on button actions for what Swift calls “Touch Up Inside”. That is, you lift a finger while inside the bounds of the button. (As opposed to when you touch down on the screen, but may or may not slide your finger away from the button before releasing to “cancel” the button press.)

But then you can also detect the number of fingers on the screen – up to 5 – and their locations and the simulator just can’t do that.

Interesting… Option Key does “kinda” work… except I can’t manuver both dots to were I want them.

Right. As far as I can tell, the simulator decides where the second dot should appear. And the position is seemingly arbitrary except to make sure you have room to pinch or zoom by moving toward or away from the other dot.

Maybe for the sake of testing in the simulator, you could treat a double tap as an alternative gesture to tapping both buttons? Then just test do final testing on a real device? Or do a long press? Or some alternative gesture anyway. Tap down inside one button then drag and release from inside the other? I think you just have to get creative if you want to do some of the testing from the simulator instead of an actual device.

You can. Hold the option key when you mouse down and while holding switch to the shift key. You should then be able to move the center to another location.

Wow, that’s a very useful tip, thanks Greg!

Gregs tip works… but maneuvering the dots is still difficult

No kidding.