Languages

Menu
Sites
Language
What should I do to get the event of home button?
Good afternoon.
 
tizen native home in the event when the button is pressed, I want to check the help article I can not find how to's ...
 
Key Press or Release through IKeyEventListener information about the Back Button for Menu or can be obtained, but
 
For the Home Key information could not be obtained.
 
Looking to help The system key events for the Home or Power key are not received, even if their key event listener is registered. I'm such terms.
 
This should not be listed.
 
Home button for the event to come get suggestions?

Responses

13 Replies
Marco Buettner
Tizen supports only back and menu as HW-Key, Home button and other buttons are currently not supported.
DAE LIM
Wow, My app was rejected because some sound does not stop when the home button or hold key is pushed. It is nonsence.
Pushpa G
Hi, You can stop the playing sound on press of Home button. When home button is pressed, the application goes to background, hence OnBackground() callback function is invoked automatically by the framework at this time. Here you can get the playing instance and stop the sound as below: void TestApp::OnBackground(void) { // TODO: // Stop drawing when the application is moved to the background. Frame *pFrame = Application::GetInstance()->GetAppFrame()->GetFrame(); if (pFrame->GetCurrentForm()==Description::Instance()) { AppLog("OnBackground::Description Form"); if(PlayingClass::Instance()->__pPlayer) //Check __ in standard { PlayingClass::Instance()->__pPlayer->Stop(); } } } After modifying your app as above, try to re-submit your app to the store
Pushpa G
sorry one correction: if (pFrame->GetCurrentForm()==PlayingClass::Instance()) { AppLog("OnBackground::PlayingClassForm");
Stefano Accorsi

Sorry .. I got the same problem but I'm developing a web app using HTML5 and Javascript and I can't find the same event listener ... is it possible? I'm developing on Gear2, is it possibile that nothing happens when I click the power button? And that there is nothing to intercept that the application is exiting? Thank you.

Marco Buettner

You can set a listener for visibilitychange ;) It will fired if the application hide or (re)show ... You can not prevent the power event.

Stefano Accorsi

Marco, you're my savior :)

I read about visibilitychange but didn't work in my app so I tried something else. But now I tried it again and it works! Probably it was me, I did something wrong the first time I tried it. Thank you again!

Seemanta Saha

Hello Mr. Marco Buettner,

I need some help regarding power/home button action listener.

I am trying to develop an web application for Samsung Gear devices.

These devices have only one hardware button.(home/power).

I need to trigger my app whenever I press the hardware button 3 times sequentially. Is it possible? If possible or if there is any alternate option pls help me.

As per UX guidline I can select app to launch after double tapping the home button through Gear Manager.

But, it would be great if I could find listener.

 

Thanks in advance.

Marco Buettner

Read the wearables documentation careful. Wearables supporting ONLY "back" button event.

Are general info for your question. Yes it is possible. You have only to count the event.

var count = 0;

function triggerEvent(e)
{
    switch(e.keyName)
    {
        case "back":
            window.history.back();
            break;
        case "menu":
            if(count<3)
            {
                count++
            }
        
            if(count === 3)
            {
                //TODO: Write what your application have to do now!
                count = 0; // change count back to initial value
            }
            break;
    }
}

document.addEventListener('tizenhwkey', triggerEvent)

 

Seemanta Saha

Do I need to press home button 3 times to do something after running the application?

Or, after installing the application, if I press home button 3 times, the application will launch? (This is my requirement)

Thanks.

Marco Buettner

Only when your application runs! For the start you need maybe another procedure... But your have to include your application in the firmware or have maybe to develop a Service Application with can handle it.

Seemanta Saha

Hello,

I am a newbie in tizen wearble develoment. Would you please let me know:

1. How can i include my application in the firmware and trigger it. OR,

2. Service application which will listen to power (back) button action.

Marco Buettner

On wearables you cannot develop services app because wearables only supports webapps as third party application... For service apps you have to use C++... 

To include your application u have to develop also an app in C or C++ and you need the source code from source.tizen.org