Compilation Units
Tagged Types
function Accelerator_Get_Accessible_Label
(Accelerator_Key : Guint;
Accelerator_Mods : Gdk.Enums.Gdk_Modifier_Type) return UTF8_String
Generates an accessible description of an accelerator. This function is similar to [funcGtk.accelerator_get_label] but it is meant for accessibility layers labels rather than user-facing labels. The output of this function is fit for [enumGtk.AccessibleProperty.KEY_SHORTCUTS]. For more information, see the WAI-ARIA reference. Since: gtk+ 4.22
accelerator keyval
accelerator modifier mask
a newly-allocated string representing the accelerator
function Accelerator_Get_Default_Mod_Mask return Gdk.Enums.Gdk_Modifier_Type
Gets the modifier mask. The modifier mask determines which modifiers are considered significant for keyboard accelerators. This includes all keyboard modifiers except for GDK_LOCK_MASK.
the modifier mask for accelerators
function Accelerator_Get_Label
(Accelerator_Key : Guint;
Accelerator_Mods : Gdk.Enums.Gdk_Modifier_Type) return UTF8_String
Converts an accelerator keyval and modifier mask into a string which can be used to represent the accelerator to the user.
accelerator keyval
accelerator modifier mask
a newly-allocated string representing the accelerator
function Accelerator_Name
(Accelerator_Key : Guint;
Accelerator_Mods : Gdk.Enums.Gdk_Modifier_Type) return UTF8_String
Converts an accelerator keyval and modifier mask into a string that can be parsed by [funcGtk.accelerator_parse]. For example, if you pass in GDK_KEY_q and GDK_CONTROL_MASK, this function returns <Control>q. If you need to display accelerators in the user interface, see [funcGtk.accelerator_get_label].
accelerator keyval
accelerator modifier mask
a newly-allocated accelerator name
function Accelerator_Parse
(Accelerator : UTF8_String;
Accelerator_Key : access Guint := null;
Accelerator_Mods : access Gdk.Enums.Gdk_Modifier_Type := null)
return Boolean
Parses a string representing an accelerator. The format looks like "<Control>a" or "<Shift><Alt>F1". The parser is fairly liberal and allows lower or upper case, and also abbreviations such as "<Ctl>" and "<Ctrl>". Key names are parsed using [funcGdk.keyval_from_name]. For character keys the name is not the symbol, but the lowercase name, e.g. one would use "<Ctrl>minus" instead of "<Ctrl>-". Modifiers are enclosed in angular brackets <>, and match the [flagsGdk.ModifierType] mask:
<Shift> for GDK_SHIFT_MASK - <Ctrl> for GDK_CONTROL_MASK -
<Alt> for GDK_ALT_MASK - <Meta> for GDK_META_MASK - <Super> for GDK_SUPER_MASK - <Hyper> for GDK_HYPER_MASK If the parse operation fails, Accelerator_Key and Accelerator_Mods will be set to 0 (zero).
string representing an accelerator
return location for accelerator keyval
return location for accelerator modifier mask
whether parsing succeeded
function Accelerator_Valid
(Keyval : Guint;
Modifiers : Gdk.Enums.Gdk_Modifier_Type) return Boolean
Determines whether a given keyval and modifier mask constitute a valid keyboard accelerator. For example, the GDK_KEY_a keyval plus GDK_CONTROL_MASK mask is valid, and matches the "Ctrl+a" accelerator. But, you can't, for instance, use the GDK_KEY_Control_L keyval as an accelerator.
a GDK keyval
modifier mask
true if the accelerator is valid