# Best way to deregister cam2d selection zoom? GLMakie - solved

**URL:** https://discourse.julialang.org/t/best-way-to-deregister-cam2d-selection-zoom-glmakie-solved/58549
**Category:** Visualization
**Tags:** makie
**Created:** [April 4, 2021, 7:06am UTC](https://discourse.julialang.org/t/best-way-to-deregister-cam2d-selection-zoom-glmakie-solved/58549 "2021-04-04T07:06:01Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![kool7d](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kool7d/32/3608_2.png) [@kool7d](https://discourse.julialang.org/u/kool7d)
#### Post date: [April 4, 2021, 7:06am UTC](https://discourse.julialang.org/t/best-way-to-deregister-cam2d-selection-zoom-glmakie-solved/58549/1 "2021-04-04T07:06:01Z")

</div>

how do I deregister the rectangle selection zoom for cam2d? `xzoomlock` and `yzoomlock` don’t work. I can stop it from zooming if I do

```julia
off(fm1.scene.events.mousedrag.listeners[1].mouseevent,
    fm1.scene.events.mousedrag.listeners[1].mouseevent.listeners[1])

```

or

```julia
deregister_interaction!(fm1.current_axis.x,:rectanglezoom)

```

but that disables the whole `process_event`.

I found where it is happening in `selection_rect!()`

```julia
if drag == Mouse.up && waspressed[]
                waspressed[] = false
                r = absrect(rect[])
                w, h = widths(r)
                if w > 0.0 && h > 0.0
                    **update_cam!(scene, cam, r)**
                end
                rect[] = FRect(NaN, NaN, NaN, NaN)
                rect_vis[1] = rect[]
            end

```

but if I define a new function with it removed it doesn’t work, so maybe I’m missing an initialization of an event or something.

The rectangle selection is great and I want to use the selection, but no zoom.

EDIT: ffreyer found the answer which is to use `select_rectangle` instead. Here’s a link to the function: [AbstractPlotting.jl/interactive\_api.jl at f30013722eb1896062ef73e80831f71404fedffa · JuliaPlots/AbstractPlotting.jl · GitHub](https://github.com/JuliaPlots/AbstractPlotting.jl/blob/f30013722eb1896062ef73e80831f71404fedffa/src/interaction/interactive_api.jl#L149)
