Adds better support for mouse callbacks and key callbacks (in OSX).