On Wed, 2020-07-01 at 20:08 -0500, David Richmond wrote: > Oh, got it. It's nice that it's mirrored on Github because it's easy > for me to fork and push changes to the forked repository. > > I hope the attached patch is formatted correctly enough?
perfect > Here is what it does, touching several files: > > - Remove unused dnm_sanitize_key_event () prototype > - Remove dnm_clean_event () altogether, and combine logic into > dnm_sanitize_key_state (), which just returned event->state > if (!Denemo.prefs.strictshortcuts) > - Remove all calls to dnm_clean_event (); replace by > dnm_sanitize_key_state () > - Implement portable logic to always take as command input the "level > 0" > unmodified value of a key, passing event->hardware_keycode to > gdk_keymap_get_entries_for_keycode() and grabbing the first keyval > in > the returned array regardless of modifier keys. See GDK docs here: > https://developer.gnome.org/gdk3/stable/gdk3-Keyboard- > Handling.html#gdk-keymap-get-entries-for-keycode This is great - the numeric keypad handling code needed simplifying which I've done, just need to re-test on Windows, which I hope to do tomorrow. Richard > > David > > On Wed, Jul 1, 2020 at 11:56 AM Richard Shann <[email protected] > m> wrote: > > On Wed, 2020-07-01 at 10:55 -0500, David Richmond wrote: > > > 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.b > > erra > > > nge.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 didn't know of the existence of this github repository - Denemo's > > official repository is on Savannah(*) - this one seems to mirror > > it. > > Could you send a patch with the changes you have? I can then test > > it on > > GNU/Linux and Windows (an ancient Vista laptop someone gave me, but > > it > > seems to be ok as a proxy for modern windows machines). > > > > Richard > > (*) > > http://git.savannah.gnu.org/gitweb/?p=denemo.git;a=summary > > > >
