Gun movement

Hi ive been playing the game receiver made by wolfire games and the way the gun moves i find really nice what would be the best way to achieve this? not the reloading and stuff just how you can move it around the screen i notice it has a box and when you go to the edges it moves the camera but that is all i know sorry for not alot of info

Why not check the source code for Receiver. The developer was nice enough to open it for personal use. That should give you a good starting point.