Codename One Adds Unified Motion, Stylus, and Trackpad APIs Across All Platforms

Codename One, an open-source framework for building native apps from a single Java or Kotlin codebase, has expanded its core APIs to support a wide range of modern input hardware. Two new pull requests introduce a com.codename1.sensors package that exposes accelerometer, gyroscope, and magnetometer data, along with derived motion values when the platform does not supply them directly. Built-in gesture recognition for actions like shake, tilt, and free fall is now available across all ports that provide accelerometer access, with hardware powering on and off automatically based on active listeners. A new PointerEvent system distinguishes between mouse, finger, stylus, and eraser inputs, capturing pressure, tilt, hover state, and button type through a unified API. Additionally, a cross-platform WheelEvent now handles mouse wheels, precision trackpads, horizontal scrolling, and the Apple Watch Digital Crown through a single consistent interface.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in