Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

handle exit button

Discussion in 'Samsung Smart TV' started by lumaluis, Dec 17, 2014.

  1. lumaluis

    lumaluis

    Joined:
    Nov 18, 2014
    Posts:
    10
    How can i handle the exit button of the remote control, i do not want that the application quit
    I want to put a popup with option if you really want to close the application.
    Thank you and sorry for my english
     
  2. AlexThibodeau

    AlexThibodeau

    Unity Technologies

    Joined:
    Jul 23, 2013
    Posts:
    309
    Hey there,

    This is how I typically catch the "Return/Exit" events:
    Code (CSharp):
    1. if (Input.GetKey (KeyCode.Escape))
    2. {
    3. // Do stuff
    4. }
    If they press and hold the Return/Exit button you won't be able to catch and stall those events however.
     
  3. lumaluis

    lumaluis

    Joined:
    Nov 18, 2014
    Posts:
    10
    ahh ok ok
    but i needed the on hold exit button, but like you say it won't be able to catch that
    thank you