As far as I know, the narrations have not mentioned regarding its necessarily to Sajdah just if you hear it attentively. Actually there must not be any difference between hearing or reciting it attentively or carelessly.
According to the fatwas of religious scholars (Maraje’ of Taqlid) it is mandatory for people to Sajdah if they hear or recite any of those verses.
Imam Khomeini:
There is a verse in each of the following Surahs that everyone who
hears or recites them, (when the verse finished), he or she must
Sajdah. And if forgot, then ought to Sajdah once he or she remembers.
1
Those verses are available in the following Surahs: (Sajdah, Foselat, Najm, Alaq)
According to some Marajeul-Taqlid (of Shi'a):
even if someone listens to the mentioned verses (unwanted), or
actually these verses move towards his ears(without his intention), he
ought to Sajdah in accordance with the Ehtiat-al-Waajeb (obligatory
caution) [2]
To see the detailed text, refer to the source below.
1 توضیح المسائل (المحشى للإمام الخمینی)، ج1، ص: 592، مسأله 1093.
(Tozihul-Masaa’el (Al-Mhshi LeEmam Al-Khomaini). Vol.1, Pg592, Mas’alah1093)
[2] آیت الله مکارم شیرازی و آیت الله شبیری زنجانی (Ayatollah Makarem Shirazi and Shobeiri Zanjani)
Source: