Added Event Polling

Included polling for keyboard and exiting window.