In my original project which did not use B4XPages I was able to trap back key by following code in Main Activity
Objective here is trap back key and close drawer if open else ask if user wants to exit without saving
Sub Activity_KeyPress (KeyCode As Int) As Boolean
Select KeyCode...