scanOnShake

fun scanOnShake(enabled: Boolean = true, shakeThresholdG: Float = 2.7f, minTriggerIntervalMillis: Long, onScanRequested: () -> Unit = defaultScanRequest)

Starts a ComposeA11yScanner scan when the device is shaken.

Call from a composable screen that wants shake-triggered scans. If no accelerometer is present, or the scanner is disabled or not installed, the default callback quietly does nothing.

Parameters

enabled

Whether shake scanning is active.

shakeThresholdG

Required acceleration force in Gs.

minTriggerIntervalMillis

Minimum time between scan triggers.

onScanRequested

Callback invoked after a qualifying shake.