acceleratorParse
fn
bool acceleratorParse(string accelerator, out uint acceleratorKey, out gdk.types.ModifierType acceleratorMods)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 [gdk.types.ModifierType] mask:
<Shift>for [gdk.types.ModifierType.ShiftMask]<Ctrl>for [gdk.types.ModifierType.ControlMask]<Alt>for [gdk.types.ModifierType.AltMask]<Meta>for [gdk.types.ModifierType.MetaMask]<Super>for [gdk.types.ModifierType.SuperMask]<Hyper>for [gdk.types.ModifierType.HyperMask]
If the parse operation fails, accelerator_key and accelerator_mods will be set to 0 (zero).
Parameters
accelerator | string representing an accelerator |
acceleratorKey | return location for accelerator keyval |
acceleratorMods | return location for accelerator modifier mask |