Used in correlative constructions ("scarcely ... when") meaning "no sooner than".
Definitions
No sooner than; used with a following clause introduced by “when” or “before” to show that one event happens immediately after another. Scarcely had she stepped outside when it began to rain.