@ KJ
I've been unable to find a solution to setting the long press of the End key to work to lock the phone without getting the endkey error message. I did just set the long pressing of the "Back" key to do that just fine with no problems. You have to use KeyboardConfig to set the back key for multiple actions, "click" being set to that key's default action and "long press" set to run the Lock Device program. I know what you exactly wanted was to use the end key, but the back key seems to be almost the same for me. I thought maybe you hadn't tried it yet and wanted to let you know.