Revert "Revert "Improved player input handling""

This reverts commit ec1c9276793f63835bb5780833ec465c84c3fdfe.