I leaned over. "Are you OK?" Figured that would be a not-too-confrontational response+. No reaction, other than the reactions he was still having, but he did stop grunting. For a bit.
Then, maybe two minutes later, he looked over at me.
"Needed something?" he said.
"I wondered how you were," I said.
"Was I noisy?" he said.
"You were getting a little loud," I said.
"I was listening to The Who," he said.
(He'd been acting like he'd been using the library computer to watch porn.)
He then said "You seem like you should have your own laptop." Seemed an odd way to make this about me, so I ignored him. But at least he stopped being noisy. And he didn't try to keep talking to me; us talking more would prooooooooobably have been a bad idea.
A few minutes after that man shut up, a 20-something woman one computer over from him got briefly noisy, too. I just looked at her. She looked at me. I tried not to look too disapproving, just looking hey, remember, library instead. She didn't get noisy again while I was there.
This could always have the chance to go badly. Handled OK or no? I feel I handled the guy OK, not so sure about the girl.
+ In 1995 I saw Heat in the theater. Good film, but long and often quiet, and the guy a few seats down from me fell snoringly asleep. I soon leaned over to him, touched his shoulder, and asked "Sir? You okay?" He came to, and thanked me for asking. Seemed a better way to confront than to say "Hey. Wake up."