언어 설정

Menu
Sites
Language
What is the correct way to deal with touch events?

Hello, guys. I'm trying to make a little game and for now I'm using this callback to deal with toucnhes:

evas_object_event_callback_add(gl, EVAS_CALLBACK_MOUSE_DOWN, mouse_down_cb, ad);

Abd it works perfect on emulator and windows mouse. So, will be it work correct on real device ? Or should I use some other things? Thank you.

Responses

8 댓글
Alex Dem

Hi,
fyi, depending on what gestures you want to implement, you could look at this tutorial:
https://developer.tizen.org/development/ui-practices/native-application/efl/ui-component-infrastructure-modules/handling-touch-gestures
​Alexey.

Nikolay Vrublevskiy

I only need to deal with tap action. Single tap, nothing more.

Nikolay Vrublevskiy

Shoud I add gestures or in my case I'm good with the code I have now ? 

Hermet Park

you could use this one, for just tap.

evas_object_event_callback_add(gl, EVAS_CALLBACK_MOUSE_DOWN, mouse_down_cb, ad);
Jeongsu Kim

I recommend to use gesture layer to detect tap gesture. Tap is an action that finger touches the screen shortly. It should triggered when finger is releaseed from the screen.

 

But EVAS_CALLBACK_MOUSE_DOWN is called when finger just pressed on the screen even finger is still on the screen which is a long tap gesture.

Alex Dem

Hi,
I don't know that way better for you.
But in case of use elm_gesture_layer you will able to separate ELM_GESTURE_N_TAPS/ELM_GESTURE_N_LONG_TAPS gestures at once.
Because of in case of 'tap'/'long tap' gesture layer callback on ELM_GESTURE_STATE_END will be called only for one(corresponding) gestureю
Alexey.

Chanwook Jung

Tap is mouse down/up operation in object. Did you use elementary widget?