Handling Long Tap Events on Buttons in Tizen Native Applications

Original Created Apr 04, 2018 | Regeneration Apr 22, 2026

I'm developing a Tizen native application and need to implement long tap functionality on buttons. From what I can see in the button properties, this feature doesn't seem to be natively supported.

I found this implementation in a code snippet: https://developer.tizen.org/community/code-snippet/native-code-snippet/long-click-implementation. Is this still the only available option?

Also, I'm concerned about whether this implementation might interfere with regular click events. Has anyone successfully implemented this functionality without affecting normal click behavior?

Problem Understanding

The user wants to implement long tap functionality on buttons in a Tizen native application. The core challenges are:

  1. Native button objects don't directly support long tap events
  2. Need to ensure the solution doesn't interfere with regular click events
  3. Looking for the most efficient implementation method

Solution Methods

  1. Gesture Layer Implementation:

    • The most reliable approach is to use Tizen's gesture layer API
    • Create a gesture layer over your button
    • Implement long tap detection using gesture callbacks
  2. Custom Timer Solution:

    • Implement touch down/up event handlers
    • Use a timer to detect long presses
    • Clear the timer if the touch is released before the threshold

Code Examples

// Gesture layer implementation example
Evas_Object *gesture_layer = elm_gesture_layer_add(button);
elm_gesture_layer_attach(gesture_layer, button);
elm_gesture_layer_cb_set(gesture_layer, ELM_GESTURE_N_LONG_TAP, 
    ELM_GESTURE_STATE_MOVE, _long_tap_cb, data);

// Timer-based implementation example
static void _button_down(void *data, Evas *e, Evas_Object *obj, void *event_info) {
    ecore_timer_add(1.0, _long_press_cb, data); // 1 second threshold
}

static void _button_up(void *data, Evas *e, Evas_Object *obj, void *event_info) {
    ecore_timer_del(timer); // Cancel if released before threshold
}

Additional Tips

  • The gesture layer method is generally more reliable and recommended
  • Set appropriate time thresholds (typically 500ms-1000ms) for long tap detection
  • Test thoroughly to ensure regular click events aren't affected
  • Consider visual feedback (like button highlight) during long press

Customize your cookie preferences

You can enable or disable non-essential cookies. Essential cookies are always on to ensure the site works properly and to keep you signed in.

Necessary

These cookies are necessary for the website to function properly and cannot be switched off. They help with things like logging in and setting your privacy preferences.

Always on

Analytics

These cookies help us improve the site by tracking which pages are most popular and how visitors move around the site.

Enable analytics cookies
Public Forum Public Forum
Employees only. Please sign in with your company account.