Implements boundary and outside view events, could be shortened some how
same for user defined events.