Fixed screen capture functionality.
Pressing the P key was not working properly, due to the order in which the conditional statement appeared. The statement has been moved to before the update phase, and is now functioning well again.