Use of an ~ing form with another verb

In 'Pete is happy while singing a song', I believe 'singing' to be part of an adjectival phrase, modifying the proper noun Peter. The same is true of 'Anna talked while screaming'.

In 'Pete is happy singing a song', 'singing a song' is an adjectival phrase modifying 'Pete'.

'They entered the room screaming'. Who was screaming? Not 'the room', not the 'entering', but it was 'they' who were screaming. So 'screaming' is modifying 'they'.

Had it been 'They entered the room quickly', then 'quickly' would have been an adverb, because it describes how they 'entered'.

Another way of putting it would be 'Whilst screaming, they entered the room'.

1