Mobile Power/Lock screen button access
I've been looking through the documentation and support forums and I haven't been able to find anything on accessing the the power/lock screen buttons for Android/IOS? Is it possible to access these features on the phone through Blueprints or C++?
asked Feb 27 '18 at 05:20 PM in Blueprint Scripting
As far as I know there are no callbacks for pressing power/lock/home button eighter for iOS and Android at all, even in native SDK (maybe in private section). You can only access the Back Button on Android (it is binded as Android Back event, check https://answers.unrealengine.com/questions/573388/how-to-exit-application-in-android-on-back-button.html )
The only thing you have in control and both OS support is the control over the lifecycle. Check the BlueprintPlatformLibrary.h file and bind into the BlueprintAssignables. You can also bind directly to the CoreDelegates.h in C++.
These delegates runs when the specific actions in the lifecycle occurs like - going to background, foreground, closing application etc.
When you press power/lock/screen button, the ApplicationWillDeactivateDelegate will launch.
answered Feb 27 '18 at 07:05 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here