Implemented manageKeys() method that manages key inputs.
All key input code was moved to manageKeys(), which handles key_ bool values.