Sorry, I couldn't resit. Plus there are so many fab pictures of it online.
I'm going to say right away... yup, he's doing what you think he's doing.
But consider this... this kid is growing up in the middle of Germany in the 1890's. That's when the originaly play was published. And in it, there is an entire scene with this kid (Hanschen) masturbating...