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

Pan/zoom not working with numlock #16

Open
ma-laforge opened this issue Mar 5, 2017 · 1 comment
Open

Pan/zoom not working with numlock #16

ma-laforge opened this issue Mar 5, 2017 · 1 comment

Comments

@ma-laforge
Copy link

I actually thought Immerse did not support pan/zoom until I saw Tim's YouTube video.

The problem is that GtkUtilities.jl is not properly masking for modifier keys that are considered "significant".

I had to replace:

keymatch(event, keydesc) = event.keyval == keydesc[1] && event.state == UInt32(keydesc[2])

With the following:

function gtk_accelerator_get_default_mod_mask()
	ccall((:gtk_accelerator_get_default_mod_mask,Gtk.libgtk),Cint,())
end

keymatch(event, keydesc) = event.keyval == keydesc[1] &&
	(event.state&gtk_accelerator_get_default_mod_mask()) == UInt32(keydesc[2])

Now, I can zoom even if my NumLock key is on... but similar masking would also be necessary on the mouse operations.

Comments

  • I did not make a PR because my guess is that accelerator_get_default_mod_mask() should be in Gtk.jl - and someone that better understands the Gtk.jl naming convention should probably be adding it.
  • Note that gtk_accelerator_set_default_mod_mask() is only supposed to be set at "application startup" - which I believe means it could potentially be stored as a const while "loading" Gtk.jl (Not sure how this would work out, though).
@ma-laforge
Copy link
Author

Oh, mabe I should include a reference:
https://developer.gnome.org/gtk3/stable/checklist-modifiers.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant