diff --git a/docs/reference/gtk/input-handling.md b/docs/reference/gtk/input-handling.md index 45b4c41416..47a0c49487 100644 --- a/docs/reference/gtk/input-handling.md +++ b/docs/reference/gtk/input-handling.md @@ -140,6 +140,11 @@ capture phase, and key bindings locally, during the target phase. Under the hood, all shortcuts are represented as instances of `GtkShortcut`, and they are managed by `GtkShortcutController`. +Note that GTK does not do anything to map the primary shortcut modifier +to Command on macOS. If you want to let your application work +on macOS, you explicitly need to provide keyboard shortcuts. +The Command is named `Meta` (`GDK_META_MASK`) in GTK. + ## Text input When actual text input is needed (i.e. not just keyboard shortcuts), diff --git a/docs/reference/gtk/migrating-3to4.md b/docs/reference/gtk/migrating-3to4.md index 05c99fa2ff..68baff2d2c 100644 --- a/docs/reference/gtk/migrating-3to4.md +++ b/docs/reference/gtk/migrating-3to4.md @@ -455,7 +455,7 @@ In GTK 4, the meaning of modifiers has been fixed, and backends are expected to map the platform conventions to the existing modifiers. The expected use of modifiers in GTK 4 is: -`GDK_CONTROL_MASK` +`GDK_CONTROL_MASK` (`GDK_META_MASK` on macOS) : Primary accelerators `GDK_ALT_MASK` @@ -464,7 +464,7 @@ The expected use of modifiers in GTK 4 is: `GDK_SHIFT_MASK` : Extending selections -`GDK_CONTROL_MASK` +`GDK_CONTROL_MASK` (`GDK_META_MASK` on macOS) : Modifying selections `GDK_CONTROL_MASK|GDK_ALT_MASK` @@ -473,6 +473,11 @@ The expected use of modifiers in GTK 4 is: Consequently, `GdkModifierIntent` and related APIs have been removed, and `` is preferred over `` in accelerators. +In GTK 3 on macOS, the `` modifier mapped to the Command key. +In GTK 4, this is no longer the case: `` is synonym to ``. +If you want to make your application to feel native on macOS, +you need to add accelerators GD for macOS that use the `` modifier. + A related change is that GTK 4 no longer supports the use of archaic X11 'real' modifiers with the names Mod1,..., Mod5, and `GDK_MOD1_MASK` has been renamed to `GDK_ALT_MASK`. diff --git a/gdk/gdkenums.h b/gdk/gdkenums.h index 106db2bc0b..e368de6c2a 100644 --- a/gdk/gdkenums.h +++ b/gdk/gdkenums.h @@ -98,9 +98,9 @@ typedef enum * @GDK_BUTTON3_MASK: the third mouse button. * @GDK_BUTTON4_MASK: the fourth mouse button. * @GDK_BUTTON5_MASK: the fifth mouse button. - * @GDK_SUPER_MASK: the Super modifier - * @GDK_HYPER_MASK: the Hyper modifier - * @GDK_META_MASK: the Meta modifier + * @GDK_SUPER_MASK: the Super modifier. + * @GDK_HYPER_MASK: the Hyper modifier. + * @GDK_META_MASK: the Meta modifier. Maps to Command on macOS. * * Flags to indicate the state of modifier keys and mouse buttons * in events.