Inputmanager change focus events (Fixes #28)

Make sure the events are properly triggered in all cases. This fixes #28, but I also found one case where eventChangeMouseFocus was broken.