W Wrapl, The Programming Language

Libraries:Gtk:Gtk:Accelerator

Functions

GetDefaultModMask() : Std.Integer.SmallT

Gets the value set by SetDefaultModMask.

Returns the default accelerator modifier mask


GetLabel(accelerator_key @ Std.Integer.SmallT, accelerator_mods @ Std.Integer.SmallT) : Std.String.T

Converts an accelerator keyval and modifier mask into a string which can be used to represent the accelerator to the user.

accelerator_key accelerator keyval
accelerator_mods accelerator modifier mask
Returns a newly-allocated string representing the accelerator.


Name(accelerator_key @ Std.Integer.SmallT, accelerator_mods @ Std.Integer.SmallT) : Std.String.T

Converts an accelerator keyval and modifier mask into a string parseable by Parse. For example, if you pass in GDK_q and Gtk.Gdk.ModifierType.ControlMask, this function returns "<Control>q".

If you need to display accelerators in the user interface, see GetLabel.

accelerator_key accelerator keyval
accelerator_mods accelerator modifier mask
Returns a newly-allocated accelerator name


Parse(accelerator @ Std.String.T, accelerator_key @ Std.Object.T, accelerator_mods @ Std.Object.T) : Std.Object.T

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 Gtk.Gdk.Keyval.FromName. 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).

accelerator string representing an accelerator
accelerator_key return location for accelerator keyval. [out][allow-none]
accelerator_mods return location for accelerator modifier mask. [out][allow-none]


SetDefaultModMask(default_mod_mask @ Std.Integer.SmallT) : Std.Object.T

Sets the modifiers that will be considered significant for keyboard accelerators. The default mod mask is Gtk.Gdk.ModifierType.ControlMask | Gtk.Gdk.ModifierType.ShiftMask | Gtk.Gdk.ModifierType.Mod1Mask | Gtk.Gdk.ModifierType.SuperMask | Gtk.Gdk.ModifierType.HyperMask | Gtk.Gdk.ModifierType.MetaMask, that is, Control, Shift, Alt, Super, Hyper and Meta. Other modifiers will by default be ignored by Gtk.Gtk.AccelGroup.T. 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.

default_mod_mask accelerator modifier mask


Valid(keyval @ Std.Integer.SmallT, modifiers @ Std.Integer.SmallT) : Std.Symbol.T

Determines whether a given keyval and modifier mask constitute a valid keyboard accelerator. For example, the GDK_a keyval plus Gtk.Gdk.ModifierType.ControlMask is valid - this is a "Ctrl+a" accelerator. But, you can't, for instance, use the GDK_Control_L keyval as an accelerator.

keyval a GDK keyval
modifiers modifier mask
Returns TRUE if the accelerator is valid