Fixed button events for the window class. Todo: Add all the missing button and key events.