InteractiveViz.jl
InteractiveViz.jl copied to clipboard
Key bindings don't work as expected on non-English keyboard
Basically, what the title says. I use a latam keyboard (Mexican Spanish is my native language) and the keys end up being mapped as follows
Original | latam |
---|---|
-/+ |
'/¿ |
[/] |
´/+ |
</> |
ñ/{ |
,/' |
;/. |
↑/↓/←/→ |
↑/↓/←/→ |
0 |
0 |
Edit: It looks like it is not affected by Mayus
modifier.
I don't have a Mexican Spanish keyboard to test on. Do you know what needs to be done to fix this?
I don't really know, but, can you point me where are the key bindings defined? Please, that way I might get an idea if is something from Makie, or from here.
(Edit: manners and rationale.)
I think I found the issue, and it's in core.jl
.
Makie uses GLFW for windows of GLMakie, in GLFW documentation states that
GLFW divides keyboard input into two categories; key events and character events. Key events relate to actual physical keyboard keys, whereas character events relate to the Unicode code points generated by pressing some of them.
GLMakie abstract the use of this through Events
, where you can access both of them. The event.key
used here correspond to the hardware key number, but the property events(c.parent.scene).unicode_input[]
correspond to the key pressed (or released) taking into account the keyboard layout.
events(c.parent.scene).unicode_input[]
is simply a Char
, and can be compared as that, so it would be easy to fix this. I'm working on a PR right now. :)
Sounds good. Look forward to the PR.
No longer relevant, as the keybindings are now handled by GLMakie directly.