emacs-devel
[Top][All Lists]
Advanced

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

Modifier handling in pgtk


From: Brennan Vincent
Subject: Modifier handling in pgtk
Date: Sat, 11 Dec 2021 18:25:38 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.1

Hello,

It seems like pgtkterm.c is simply always assuming that mod4 corresponds
to the super key, mod3 to hyper, and so on. For example, in this code
from x_find_modifier_meanings :

  state = GDK_HYPER_MASK;
  r = gdk_keymap_map_virtual_modifiers (keymap, &state);
  if (r)
    {
      /* Hyper key exists. */
      if (state == GDK_HYPER_MASK)
        {
          dpyinfo->hyper_mod_mask = GDK_MOD3_MASK;   /* maybe this is hyper. */
        }
      else
        {
          dpyinfo->hyper_mod_mask = state & ~GDK_HYPER_MASK;
        }
    }
  else
    {
      dpyinfo->hyper_mod_mask = GDK_MOD3_MASK;
    }

Later when we receive key events, we will check them against this
`hyper_mod_mask` and therefore think that any with mod3 set have the
hyper key set. The result is that things won't work right for people who
have used xmodmap to change which modifier flags hyper, super, etc. are
mapped to.

I'm confused about what's going on here -- why do we need to set up this
state in dpyinfo at all; why can't we just compare against
GDK_HYPER_MASK, GDK_SUPER_MASK, etc. directly in



reply via email to

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