Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR: Add ability to change the "reset zoom" binding #3950

Open
david-macmahon opened this issue Jun 9, 2024 · 1 comment · May be fixed by #4531
Open

FR: Add ability to change the "reset zoom" binding #3950

david-macmahon opened this issue Jun 9, 2024 · 1 comment · May be fixed by #4531
Labels
Axis related to `Axis()` objects enhancement Feature requests and enhancements good first issue This should come with some instructions! interaction anything event related Makie Backend independent issues (Makie core)

Comments

@david-macmahon
Copy link

MacOS seems quite adamant about claiming “Ctrl+Left Click” for “Right Click” and I can’t find any way to alter that, so if I lose my place when zooming I have no (easy) way to get back to the starting position. It would be great if the "reset zoom" binding could be changed to something else. Apparently it is adjustable for PolarAxis already, so maybe that could be copied more broadly.

@david-macmahon david-macmahon added the enhancement Feature requests and enhancements label Jun 9, 2024
@ffreyer
Copy link
Collaborator

ffreyer commented Aug 28, 2024

Should be fairly simple to fix. The keys are hardcoded here:

function process_interaction(::LimitReset, event::MouseEvent, ax::Axis)
if event.type === MouseEventTypes.leftclick
if ispressed(ax.scene, Keyboard.left_control)
if ispressed(ax.scene, Keyboard.left_shift)
autolimits!(ax)
else
reset_limits!(ax)
end
return Consume(true)
end
end
return Consume(false)
end

these should be changed to something like ispressed(ax.scene, ax.reset_button) with reset_button added in here:
@attributes begin

Note that you can also combine buttons/keys with ispressed, e.g. as Keyboard.left_control & Mouse.left. Note also that after #4131 Axis3 will need the same attributes

@ffreyer ffreyer added good first issue This should come with some instructions! interaction anything event related Makie Backend independent issues (Makie core) Axis related to `Axis()` objects labels Aug 28, 2024
@EdsterG EdsterG linked a pull request Oct 25, 2024 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Axis related to `Axis()` objects enhancement Feature requests and enhancements good first issue This should come with some instructions! interaction anything event related Makie Backend independent issues (Makie core)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants