Ugh. We caught a kid doing that in my high school library last May. We radioed for help. The campus supervisor walked him outside, talked to him about it, and sent him back to us to finish the test he was working on. I couldn't believe it. Later, we told admin about it and had to write witness statements. He was a freshman and said it's what he does at home when he's sitting around, and didn't realize he was doing it. None of the students know, as far as I'm aware. We all kept it very quiet.
This was (and possibly is) a huge issue in a neighboring school. Someone would say he'd flip the health textbook to page 258 and focus on the attractive stock image person on the page. One day there was a confrontation about it that seemed to blow over when the person said "well it IS health class!"
My school had a kid do that in class under the desk. One of the more hated teachers in the school caught him and asked what he was doing. His reply, "Nothing if you don't want to join."