TricksWithHats
After getting the hat to your foot (the knock to foot is the most common way, but there are plenty of others) you can hop and quickly remove your foot from the hat. Quickly get your throwing foot onto the ground and place the other foot inside the hat. As you can see from the video the hat stays fairly still and it's you that does all the movement.
This video of the hat being spun as it is thrown between the feet should give you some ideas for variations on this trick.