On a separate thread, Richard and I were discussing problems with the
keyboard shortcuts on MacOS.

I did a little digging, and it seems that this issue of hardware keycodes
is not even platform-independent on Linux:
https://www.berrange.com/tags/key-codes/

So, I replaced the direct keycode logic in dnm_clean_event () with a GDK
call that pulls out what GDK calls the "first level" for a given hardware
code. We can just pass the hardware code from the key event to get it. That
gives us back, for example, lowercase letters instead of uppercase with
shift, and numbers on the top-row number keys instead of, e.g., the
parentheses.

I opened a pull request on github with the relevant changes. I would love
to hear testing feedback on multiple platforms. As I mentioned, I am a very
inexperienced developer, so hopefully I didn't break anything else with
this change. I am also worried that I did not implement g_free() correctly
at core/kbd-custom.c:169-170. Am I actually freeing the returned array? The
double pointer syntax in the GDK docs is very confusing. The documentation
for the GDK call I'm using is here:
https://developer.gnome.org/gdk3/stable/gdk3-Keyboard-Handling.html#gdk-keymap-get-entries-for-keycode
.

This change immediately fixes all apparent keyboard shortcut issues for me
on the Mac.

David

Reply via email to