# multiTouch input

**URL:** https://forum.kirupa.com/t/multitouch-input/315777
**Category:** Uncategorized
**Created:** [November 3, 2010, 7:57pm UTC](https://forum.kirupa.com/t/multitouch-input/315777 "2010-11-03T19:57:22Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![tbo](https://avatars.discourse-cdn.com/v4/letter/t/7feea3/32.png) [@tbo](https://forum.kirupa.com/u/tbo)
#### Post date: [November 3, 2010, 7:57pm UTC](https://forum.kirupa.com/t/multitouch-input/315777/1 "2010-11-03T19:57:22Z")

</div>

i am doing this:  
press buttons on screen to move character left or right, “swipe” elsewhere on screen to do other stuff.

This is how i have handled it:

> Multitouch.inputMode = MultitouchInputMode.TOUCH\_POINT;

stage.addEventListener(TouchEvent.TOUCH\_BEGIN, onTouchBegin);  
stage.addEventListener(TouchEvent.TOUCH\_END, onTouchEnd);  
buttonContainer.addEventListener(TouchEvent.TOUCH\_OVER, tOver);  
buttonContainer.addEventListener(TouchEvent.TOUCH\_OUT, tOut);  
this works fine, just wondering if anyone has another way to handle it. it seems excessive to have 4 handlers for touch input, but i cant figure out any other way.

TOUCH\_OVER and TOUCH\_OUT check a switch statement to enable/disable buttons within buttonContainer.

TOUCH\_BEGIN and TOUCH\_END are used to store points and get a “swipe angle” (only if TOUCH\_END is not over a button)

my only problem is i started having glitch’s i think becuase so many listeners including: ORIENTATION\_CHANGE, KeyboardEvents, Event.DEACTIVATE

this is why i ask if perhaps im missing someway to simplify the touch input listeners

thanks!
