简体   繁体   中英

How do I ignore an extra finger on the screen?

I am working on an app for small kids. The app is basically an eye candy game where the kid can touch the screen and make flowers or balloons appear. I am using touchesBegan: and touchesend: to figure out when the kid is pressing down (start the animation) and when he lifts his finger up (stop the animation).

My problem is that, some of the kids I beta tested, with held the iPhone with their thumb on the screen. This extra touch messes with my logic that controls the position of the animation. I believe I can take care of this with one of two methods

  1. setting exclusive touch so that once the first finger is down, all other touches are ignored, thus forcing the child to lift their thumb up if they want to make the game do anything.

  2. by capturing the position of the touch begin and making sure that in my touch end logic, I am responding to the correct finger.

I was just curious if anyone else has run into this problem and if they had come up with a better approach.

I went with #1 "setting exclusive touch so that once the first finger is down, all other touches are ignored, thus forcing the child to lift their thumb up if they want to make the game do anything." I tested it with a few kids and very quickly they figured out what the "rules" were and adapted.

What age group? From observing 1-, 3-, and 5-year olds with touch screen phones, it seems to me that at the age where the child could be trusted to hold the phone and not drop it (late two or early three) they can learn how to hold the phone on a palm. The ones who need to grip can easily, after being shown only once in most cases, learn to grip with the thumb from the top and bottom areas where there is no screen.

I agree that your app should handle the errant input intelligently, but don't discount minimum instruction in the general use of the phone (holding it) first. This isn't a case of 'fix the user' but rather a skill that the user (the child) will need to use any app on the phone.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM