{ "id": "170577", "key": "TIMOB-25644", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": null, "resolutiondate": null, "created": "2017-12-11T09:29:32.000+0000", "priority": null, "labels": [], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-02-28T19:54:59.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [], "description": "Hi guys,\r\nI think many of developers who uses newer phones has to check, if device has physical or software back button, menu button and home button.\r\nIf they are software buttons, I have to calculate screen size - height of this buttons.\r\nIt will be very nice to have property to check for this in native Titanium without Hyperloop.\r\nI check it like this:\r\n\r\n{code:java}\r\nvar keyCharacterMap = require('android.view.KeyCharacterMap');\r\nvar keyEvent = require('android.view.KeyEvent');\r\nvar hasBackButton = keyCharacterMap.deviceHasKey(keyEvent.KEYCODE_BACK);\r\n{code}\r\n\r\nI tested with Nexus 5X (software buttons, hasBackButton = false) and Samsung Galaxy A5(physical buttons, hasBackButton = true).\r\n\r\nThanks in advance for response", "attachment": [], "flagged": false, "summary": "Check for physical/software buttons", "creator": { "name": "max87", "key": "max87", "displayName": "Marian Kucharcik", "active": true, "timeZone": "Europe/Prague" }, "subtasks": [], "reporter": { "name": "max87", "key": "max87", "displayName": "Marian Kucharcik", "active": true, "timeZone": "Europe/Prague" }, "environment": null, "comment": { "comments": [], "maxResults": 0, "total": 0, "startAt": 0 } } }