scanOnShake

fun scanOnShake(enabled: Boolean = true, shakeThresholdG: Float = 2.7f, minTriggerIntervalMillis: Long, onScanRequested: () -> Unit = { ComposeA11yScanner.triggerScan() })

Starts a ComposeA11yScanner scan when the device is shaken.

Call from a composable screen that wants shake-triggered scans. If no accelerometer is present, this 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.