Added support for WASD input, fixed event polling.