[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fixing keyboard bugs in a portable way

From: David Richmond
Subject: Re: Fixing keyboard bugs in a portable way
Date: Wed, 1 Jul 2020 20:08:27 -0500

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? 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:


On Wed, Jul 1, 2020 at 11:56 AM Richard Shann <> 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.berra
> 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).


Attachment: portable-keys.patch
Description: Binary data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]