24

I just saw a weird shortcut in dconf-editor:

<Primary><Alt>KP_End

What is <Primary>?

I also saw an Above-Tab key. I completely understand what that refers to, but where are those key-names defined?

This also applies to XFCE and xfconf-query.

Kusalananda
  • 320,670
  • 36
  • 633
  • 936
Robert Siemer
  • 1,885
  • 1
  • 23
  • 29

1 Answers1

23

<Primary> is a gtk+ thing.
gtk+ 2.24.7 & gtk+ 3.2.1 introduced the concept of a platform-agnostic accelerator modifier, <Primary>, which can be used instead of <Control>:

a new facility is provided in Gtk+ (as of this writing it is in Git for Gtk+-2.24, and released in Gtk+-3.2.0) to use the <Primary> descriptor in place of <Control> for accelerators and bindings. This will map the accelerator to Command on OSX and to Control for anything else.1

As per this commit:

gtk: allow to specify accelerators in a platform-independent way. Introduce <Primary> in accelerator strings, which resolves to GDK_CONTROL_MASK on X11/Win23, and to GDK_META_MASK on quartz.

it is defined (along with other accelerators) in gtkaccelgroup.c

gtk_accelerator_name (guint accelerator_key,
                     GdkModifierType accelerator_mods)
{
  static const gchar text_release[] = "<Release>";
  static const gchar text_primary[] = "<Primary>";
  static const gchar text_shift[] = "<Shift>";
  static const gchar text_control[] = "<Control>";
  static const gchar text_mod1[] = "<Alt>";
  static const gchar text_mod2[] = "<Mod2>";
  static const gchar text_mod3[] = "<Mod3>";
  static const gchar text_mod4[] = "<Mod4>";
  static const gchar text_mod5[] = "<Mod5>";
  static const gchar text_meta[] = "<Meta>";
  static const gchar text_super[] = "<Super>";
  static const gchar text_hyper[] = "<Hyper>";

<Above_tab> is a window manager thing.
As per this commit in metacity:

We want switching between the windows of an application to be an easily accessible operation. The convenient and memorable keybinding is the key above the tab key - but the keysym for that key isn't consistent across different keyboard layouts. Add code that figures out the key from the XKB geometry and a magic keysym name "Above_Tab" that refers to this key and switch the default binding for cycle_group to Above_Tab

See also this commit in mutter and source files meta-accel-parse.c and meta-accel-parse.h

don_crissti
  • 79,330
  • 30
  • 216
  • 245
  • 1
    Gosh, how confusing. Do you mean it’s normally a GNOME thing, except that Above-Tab and Primary are mutter-only?? (I.e. only mutter can understand shortcut descriptions containing those?) – Robert Siemer Nov 17 '14 at 22:09