From the angle of the video tweeted out, it looks like the president took the kids hat, signed it and then tossed it to whoever wanted to catch it.

However, thanks to a second camera angle courtesy of Micah Grimes with NBC Nightly News, the wider shot shows the president walking up, a kid wearing a light blue shirt and khakis hands the president his hat. The president signs the hat, throws it and the same kid catches it.