In my App Golf_SC (Scorecard for Golf) I would like to prevent the ESC/Back button to cause the App to terminate (nominally, with saved properties and cleaned up environment etc.) and rather close and terminate the app by a corresponding menu item only.
I know that this is a bit against the conventions that F3 users are used to and might expect, but there is a good reason, that would apply also for further cases (see below):
When I have the app open and running during a golf round, the process of hitting the ball with a glove sometimes presses the back button without intention. I then find myself with a terminated activity recording, and have to restart the app. Therefore I'd like to intercept the ESC key (is that possible by returning "true"?) and then initiate app termination by responding to a menu item.
Could anybody from the more experienced people here give a hint?