Improved check for valid player actions

Moved checks to a single function which is called while trying to perform keyboard / mouse actions and set correct return values.