reword event handler to take a user-supplied closure, implement mouse handling, add immediate update to drawing code, increase event processing rate