Determining if phone has softkeys on Android

I am fairly new with Haxe and Openfl. I’m creating an application with Android target. I want to determine whether the phone has hardware or softkeys. Based on this information I want to hide or show a back button in my apps navigation.

There exists a Java API but I have not yet worked with Haxe externs or embedding Java code and such:

How can I invoke this Java code from within an openfl app?

boolean hasMenuKey = ViewConfiguration.get(context).hasPermanentMenuKey();
boolean hasBackKey = KeyCharacterMap.deviceHasKey(KeyEvent.KEYCODE_BACK);

Any help is appreciated! Thanks!

  • gorwell

This sounds like a job for extensions!

I’ll check this out. Thanks!