3

I'm trying to build Tizen wearable native app with Kiosk mode. Like getting admin access.

So far i found this KNOX SDK for Tizen native app. But i can't found any documentation related to importing that library and can't find any samples.

Is there any other way to override hardware keys.

uday
  • 1,348
  • 12
  • 27

1 Answers1

1

I don't know about KIOSK MODE.

But I will write about hardware key override. First of all, you can find about hardware key grab in link https://developer.tizen.org/development/ui-practices/native-application/efl/hardware-input-handling/grabbing-hardware-key-events

You can find hardware key name as below code. and all hardware key name is listed below link.

https://developer.tizen.org/development/ui-practices/native-application/efl/hardware-input-handling/grabbing-hardware-key-events#keystring

    #incldue <Ecore.h>
    #include <efl_extention.h>

    static void
    create_base_gui(appdata_s *ad)
    {
        :
        //  evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, NULL);
        //  eext_object_event_callback_add(ad->win, EEXT_CALLBACK_BACK, win_back_cb, ad);
         eext_win_keygrab_set(ad->win, "XF86Home");
        :
    }
    static Eina_Bool
    _key_down_cb (void *data, int type, void *ev)
    {
        Ecore_Event_Key *event = ev;

        dlog_print(DLOG_ERROR, LOG_TAG, "key is %s", event->key);

       // Let the event continue to other callbacks which have not been called yet
       return ECORE_CALLBACK_DONE;
    }

    static bool
    app_create(void *data)
    {
        appdata_s *ad = data;

        create_base_gui(ad);
       :
        ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, _key_down_cb, NULL);

    }

This sample code based on BasicUi online example code in SDK.

  • Using ecore_event_handler_add() we can get callback but we cant override the event. if we click home button we can get the call back but we can't stop app from closing – uday Feb 26 '16 at 12:58
  • I've checked in sample project named BasicUi. insert code 'eext_win_keygrab_set(ad->win, "XF86Home");' in app create. and delete smart_callback and event_callback. and you can grab Home key without app termination. I added more answer in previous. – SeokHoon LEE Feb 29 '16 at 08:19
  • eext_win_keygrab_set(ad->win, "XF86Home"); method in not available in wearable. IDE shows error like this "implicit declaration of function 'eext_win_keygrab_set' is invalid in C99 [-Werror,-Wimplicit-function-declaration]" – uday Feb 29 '16 at 08:45
  • 1
    You are right, eext_win_keygrab_set is suppoted from tizen 2.4. I can not find any api for stop hardware key override without app closing. – SeokHoon LEE Feb 29 '16 at 09:37