Lazarus

Programming => Operating Systems => Android => Topic started by: Manlio on April 16, 2019, 07:08:06 pm

Title: LAMW question: how to exit after intercepting (and muting) KEYCODE_BACK
Post by: Manlio on April 16, 2019, 07:08:06 pm
I understand that in OnSpecialKeyDown we can intercept the Back button press (if keyCodeString = 'KEYCODE_BACK')  and cancel it (mute := True).

In that situation the app will not close, the form will remain open, OnCloseQuery, OnClose, etc. will not be called and the app will continue running normally.

However, I would like that after the above Back key is pressed, the app should disappear as if the Home key had been pressed. By that I mean that the app should continue running (well, actually it will be paused) but free the screen as if Home was pressed.

So, after cancelling Back, What command do I have to execute to achieve that?
Title: Re: LAMW question: how to exit after intercepting (and muting) KEYCODE_BACK
Post by: Manlio on April 19, 2019, 04:19:49 pm
I figured out the answer: call jForm.Minimize();

Cheers
Title: Re: LAMW question: how to exit after intercepting (and muting) KEYCODE_BACK
Post by: jmpessoa on April 19, 2019, 08:10:22 pm

Good!!

Thank you!!