Android O feature spotlight: Google explains the new actionable battery menu
Android O feature spotlight: Downloadable fonts will make APKs smaller, and fonts can now be XML resources
Android O feature spotlight: Apps can finally capture the mouse pointer
Android O feature spotlight: VolumeShaper lets audio apps perform cross fades, fade-outs, and more
Android O feature spotlight: You can automatically enable WiFi near trusted networks, and it now works in DP2
- View All 73 Articles In This Series
Android has never really been designed for use on desktop or laptop PCs, but various ports like Android x86 and Remix OS have appeared over the years. Now that Android apps can run on Chromebooks, perhaps Google thought it was finally time to implement pointer capture support in Android.
Starting with Android O, apps can capture a device's mouse pointer using the new requestPointerCapture method. This will cause the on-screen pointer to disappear, and all mouse events will be transmitted to the application. It works exactly like mouse locking on desktop operating systems.
I'm actually really excited for this change. This will massively improve remote desktop software on Android, as well as any games that need to lock the mouse (such as first-person shooters). This will be great for computer emulators too, such as DOSBox or KEGS.
Android will automatically release the pointer capture if the app is closed or otherwise loses focus. Developers can find more information at the source link below. Unlike some other Android O features we have covered, this is not being back-ported to earlier Android versions via the Support Library.
- Android Developers