added setReactToMouseAndKeyEvents function