I worry that mouse events are sent separately from how the mouseMode is set and you might get a bogus assert once in a while. It would be better to assert only in debug builds in case that turns out to be a real issue (and in non-debug builds, just return if the mouseMode is not right)