Is there a way how to detect if the user has access to the device BACK and MENU keys?
In ANDROID it's a simply code:
boolean hasMenuKey = ViewConfiguration.get(context).hasPermanentMenuKey();
boolean hasBackKey = KeyCharacterMap.deviceHasKey(KeyEvent.KEYCODE_BACK);
But how do it in DELPHI?
To determine the presence of a hardware keys, this method is the easiest:
.
.
uses
Androidapi.KeyCodes,
Androidapi.JNI.GraphicsContentViewText,
.
.
TJKeyCharacterMap.JavaClass.deviceHasKey(AKEYCODE_BACK) //To detect hardware BACK
TJKeyCharacterMap.JavaClass.deviceHasKey(AKEYCODE_MENU) //To detect hardware MENU
.
.
Result for deviceHasKey is Boolean.
All keycode constants can be found in unit Androidapi.KeyCodes.