Finished the mouse and keyboard events; also added focus.