add mouse event infrastructure
reworking pattern view code