Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Touches linger between sessions #27

Open
jlytledistinctdev opened this issue Feb 7, 2012 · 3 comments
Open

Touches linger between sessions #27

jlytledistinctdev opened this issue Feb 7, 2012 · 3 comments

Comments

@jlytledistinctdev
Copy link
Contributor

Under the right conditions, touches linger after the app is backgrounded on iOS, and then are delivered to Lua via the callbacks with many of the values as nil immediately upon resuming. I'll attach some test code that demonstrates this case. To reproduce, just add the follow code to the anim-basic sample, by putting a print statement in it for each of its parameters like so:

MOAIInputMgr.device.touch:setCallback (
function ( eventType, index, x, y, tapCount )
print ( eventType, index, x, y, tapCount )
end
)

You then run on a device, then drag your finger around constantly. While dragging, hit the home key. Then, watch the console output and reopen the app on the device. Sometimes you'll see a new print out (or multiple) that have nil values for many of the parameters. That's your repro case. I'd suggest that the queue of touch events be cleared out as this bug can cause some pretty serious issues in the right conditions.

@jlytledistinctdev
Copy link
Contributor Author

Here's an example of what you'll see in your console if you reproduce the error. Note the final line, which indicates the error:

1 0 247 545 1
1 0 252 557 1
1 0 256 561 1
1 0 256 562 1
1 0 261 563 1
1 0 267 563 1
1 0 276 561 1
1 0 294 552 1
1 0 304 550 1
1 0 309 549 1
1 0 311 549 1
1 0 311 537 1
1 0 301 510 1
1 0 284 487 1
1 0 271 476 1
1 0 260 471 1
1 0 251 467 1
1 0 242 461 1
1 0 230 457 1
1 0 216 449 1
1 0 199 441 1
3 nil nil nil nil

@ghost
Copy link

ghost commented Feb 8, 2012

This also occurs if you click outside of the moai window and then back in.
The click outside will obviously not register but the next time one clicks inside the window, the x,y will be given from outside.

@patrickmeehan
Copy link
Member

Am moving this issue to moai-dev. Will check it out soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants