Barely / hardly (ledwo / ledwie)

To express that one event had barely or hardly finished before another suddenly occurred, use ledwo or ledwie.

Start the first clause with ledwo or ledwie followed by a past-tense verb. The interrupting event follows in the second clause, also in the past tense. Usually, the two clauses are simply separated by a comma.

They had barely discovered this cave when the flashlights started to flicker.
Ledwo odkryli tę jaskinię, latarki zaczęły migotać.

Ledwo and ledwie are interchangeable:

They had barely crossed the threshold when the flashlight went out.
Ledwie przeszli przez próg, latarka zgasła.
They had barely taken a step when a strange chill engulfed them.
Ledwie zrobili krok, ogarnął ich dziwny chłód.

While a simple comma is the most common connection, you will sometimes see the second clause introduced with gdy (when), which closely mirrors the English structure "had barely... when":

The explorers had barely entered the cave when the flashlight began to flicker in the gloom.
Odkrywcy ledwo weszli do jaskini, gdy latarka zaczęła migotać w półmroku.