Skip to content

Pan/zoom not working with numlock #16

@ma-laforge

Description

@ma-laforge

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions