Functions
gtk_accel_group_activate ()
gboolean
gtk_accel_group_activate (GtkAccelGroup *accel_group,
GQuark accel_quark,
GObject *acceleratable,
guint accel_key,
GdkModifierType accel_mods);
Finds the first accelerator in accel_group
that matches
accel_key
and accel_mods
, and activates it.
Returns
TRUE if an accelerator was activated and handled
this keypress
gtk_accel_group_lock ()
void
gtk_accel_group_lock (GtkAccelGroup *accel_group);
Locks the given accelerator group.
Locking an acelerator group prevents the accelerators contained
within it to be changed during runtime. Refer to
gtk_accel_map_change_entry() about runtime accelerator changes.
If called more than once, accel_group
remains locked until
gtk_accel_group_unlock() has been called an equivalent number
of times.
gtk_accel_groups_activate ()
gboolean
gtk_accel_groups_activate (GObject *object,
guint accel_key,
GdkModifierType accel_mods);
Finds the first accelerator in any GtkAccelGroup attached
to object
that matches accel_key
and accel_mods
, and
activates that accelerator.
Returns
TRUE if an accelerator was activated and handled
this keypress
gtk_accel_groups_from_object ()
GSList *
gtk_accel_groups_from_object (GObject *object);
Gets a list of all accel groups which are attached to object
.
Returns
a list of
all accel groups which are attached to object
.
[element-type GtkAccelGroup][transfer none]
gtk_accel_group_find ()
GtkAccelKey *
gtk_accel_group_find (GtkAccelGroup *accel_group,
GtkAccelGroupFindFunc find_func,
gpointer data);
Finds the first entry in an accelerator group for which
find_func
returns TRUE and returns its GtkAccelKey.
Returns
the key of the first entry passing
find_func
. The key is owned by GTK+ and must not be freed.
[transfer none]
gtk_accelerator_valid ()
gboolean
gtk_accelerator_valid (guint keyval,
GdkModifierType modifiers);
Determines whether a given keyval and modifier mask constitute
a valid keyboard accelerator. For example, the GDK_KEY_a keyval
plus GDK_CONTROL_MASK is valid - this is a “Ctrl+a” accelerator.
But, you can't, for instance, use the GDK_KEY_Control_L keyval
as an accelerator.
Returns
TRUE if the accelerator is valid
gtk_accelerator_parse ()
void
gtk_accelerator_parse (const gchar *accelerator,
guint *accelerator_key,
GdkModifierType *accelerator_mods);
Parses a string representing an accelerator. The format looks like
“<Control>a” or “<Shift><Alt>F1” or “<Release>z” (the last one is
for key release).
The parser is fairly liberal and allows lower or upper case, and also
abbreviations such as “<Ctl>” and “<Ctrl>”. Key names are parsed using
gdk_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>-”.
If the parse fails, accelerator_key
and accelerator_mods
will
be set to 0 (zero).
gtk_accelerator_get_label ()
gchar *
gtk_accelerator_get_label (guint accelerator_key,
GdkModifierType accelerator_mods);
Converts an accelerator keyval and modifier mask into a string
which can be used to represent the accelerator to the user.
Returns
a newly-allocated string representing the accelerator.
Since: 2.6
gtk_accelerator_parse_with_keycode ()
void
gtk_accelerator_parse_with_keycode (const gchar *accelerator,
guint *accelerator_key,
guint **accelerator_codes,
GdkModifierType *accelerator_mods);
Parses a string representing an accelerator, similarly to
gtk_accelerator_parse() but handles keycodes as well. This is only
useful for system-level components, applications should use
gtk_accelerator_parse() instead.
If accelerator_codes
is given and the result stored in it is non-NULL,
the result must be freed with g_free().
If a keycode is present in the accelerator and no accelerator_codes
is given, the parse will fail.
If the parse fails, accelerator_key
, accelerator_mods
and
accelerator_codes
will be set to 0 (zero).
Since: 3.4
gtk_accelerator_get_label_with_keycode ()
gchar *
gtk_accelerator_get_label_with_keycode
(GdkDisplay *display,
guint accelerator_key,
guint keycode,
GdkModifierType accelerator_mods);
Converts an accelerator keyval and modifier mask
into a (possibly translated) string that can be displayed to
a user, similarly to gtk_accelerator_get_label(), but handling
keycodes.
This is only useful for system-level components, applications
should use gtk_accelerator_parse() instead.
Returns
a newly-allocated string representing the accelerator.
Since: 3.4
gtk_accelerator_set_default_mod_mask ()
void
gtk_accelerator_set_default_mod_mask (GdkModifierType default_mod_mask);
Sets the modifiers that will be considered significant for keyboard
accelerators. The default mod mask depends on the GDK backend in use,
but will typically include GDK_CONTROL_MASK | GDK_SHIFT_MASK |
GDK_MOD1_MASK | GDK_SUPER_MASK | GDK_HYPER_MASK | GDK_META_MASK.
In other words, Control, Shift, Alt, Super, Hyper and Meta. Other
modifiers will by default be ignored by GtkAccelGroup.
You must include at least the three modifiers Control, Shift
and Alt in any value you pass to this function.
The default mod mask should be changed on application startup,
before using any accelerator groups.
gtk_accelerator_get_default_mod_mask ()
GdkModifierType
gtk_accelerator_get_default_mod_mask (void);
Gets the modifier mask.
The modifier mask determines which modifiers are considered significant
for keyboard accelerators. See gtk_accelerator_set_default_mod_mask().
Returns
the default accelerator modifier mask