CNA-PLAT-014: Compass and Motion work only on Android; desktop sensors come only through the SDL3 platform, and web targets are refused

CNA snapshot c1c316b9  ·  Known Issues › Platform limitations  ·  source links pinned to c1c316b9

✓

Evidence basis: source-verified at the pinned commit; tests exist (not executed for this page). Claims on this page were checked by reading the CNA source at commit c1c316b9; unless a sentence says otherwise, nothing here was built or executed. Nothing on this page was executed unless the Evidence section says so.

Compass::IsSupported and Motion::IsSupported are false everywhere except Android, as SDL3 exposes no magnetometer or fused-orientation API; Accelerometer and Gyroscope read real sensors on Android, iOS and desktop, never in a browser.

Identifier
CNA-PLAT-014
Category
Platform limitation
Subsystem
Platforms
Status
Open
Verified against
CNA c1c316b9 (c1c316b9c7a846ce8002809c151fcd1af14942c9)
Evidence basis
Source-verified: read at TARGET, not executed
Tests touching this area
Yes: see Current tests
Affected contract
Compass, Motion, Accelerometer and Gyroscope IsSupported per target

Expected behaviour

WP7's four sensor classes on every CNA target.

Actual behaviour at TARGET

Compass.cpp returns the Android backend's answer under __ANDROID__ and false otherwise (“SDL3 exposes no magnetometer/compass API on any supported platform”); Motion.cpp has the same shape. Accelerometer.cpp accepts Android, iOS and Desktop targets and excludes the browser “by the established target policy”.

Since INPUT-EMU-001 (31a560af9) Accelerometer has an opt-in keyboard emulation (setKeyboardEmulationEnabledEXT): while it is on, IsSupported is true on every target, browser included, but readings come from the keyboard, not a sensor.

Source locations

Evidence

Checked by reading at c1c316b9; not executed.

Focused reproduction

No focused reproduction is known. Nothing has been invented here; the evidence above is what exists.

Current tests

The not-supported paths are unit tested on the host.

Regression test

None; a new backend would bring its own tests.

Blast radius

Games using Compass or Motion outside Android, or any sensor in a browser build.

Workaround

Check IsSupported and fall back to other input.

The same subject is explained at several altitudes. These are the neighbouring pages at each one.

User guide
Sensors guide