Gtk2::Accelerator(3)
π Gtk2::Accelerator π
okay bestie, so this is the Gtk2::Accelerator page β it's the lil module that handles keyboard accelerators (aka keyboard shortcuts, the thing that makes Ctrl+S save your doc instead of doing nothing and making you cry). it ships as part of the gtk2-perl docs, the "User Contributed Perl Documentation" corner of the world. it's not long, but every single method here is carrying its weight, so let's get into it β¨
β¨ NAME β¨
Gtk2::Accelerator β the vibe is: shortcuts, but make it Perl π
πΈ METHODS πΈ
π¦ modifiertype = Gtk2::Accelerator->get_default_mod_mask
reads out the current default modifier mask. that's the set of modifier keys (shift, ctrl, alt-ish stuff) that count as "modifiers" by default when an accelerator gets parsed. no arguments, it just tells you what's up π
π«Ά Gtk2::Accelerator->set_default_mod_mask ($default_mod_mask)
sets that default modifier mask to whatever you hand it. one arg:
$default_mod_maskβ aGtk2::Gdk::ModifierType(that's the flag type, we get to it lower down)
β string = Gtk2::Accelerator->get_label ($accelerator_key, $accelerator_mods)
gives you back the human-readable label for an accelerator β the cute lil string you'd actually show a user. takes two things:
$accelerator_keyβ an integer (the key itself)$accelerator_modsβ aGtk2::Gdk::ModifierType
Since: gtk+ 2.6 β so if you're on anything older, this one's just not there, no cap
π string = Gtk2::Accelerator->name ($accelerator_key, $accelerator_mods)
same energy as get_label but gives you the accelerator's name string. args:
$accelerator_keyβ an integer$accelerator_modsβ aGtk2::Gdk::ModifierType
π₯ (accelerator_key, accelerator_mods) = Gtk2::Accelerator->parse ($accelerator)
the glow-up method β¨ you hand it an accelerator string and it breaks it apart into its pieces. args:
$acceleratorβ a string
and it returns two things:
accelerator_keyβ an unsigned integeraccelerator_modsβ aGtk2::Gdk::ModifierType
it's giving "one string in, two values out", and honestly? iconic π
π boolean = Gtk2::Accelerator->valid ($keyval, $modifiers)
the vibe check π returns a boolean telling you whether this key + modifier combo is actually a valid accelerator. args:
$keyvalβ an integer$modifiersβ aGtk2::Gdk::ModifierType
π ENUMS AND FLAGS π
π§ flags Gtk2::Gdk::ModifierType
here's the whole roster of modifier flags, each one with its Perl-style name and its C-style name. every single one, bestie, we are not skipping anybody:
'shift-mask'/'GDK_SHIFT_MASK''lock-mask'/'GDK_LOCK_MASK''control-mask'/'GDK_CONTROL_MASK''mod1-mask'/'GDK_MOD1_MASK''mod2-mask'/'GDK_MOD2_MASK''mod3-mask'/'GDK_MOD3_MASK''mod4-mask'/'GDK_MOD4_MASK''mod5-mask'/'GDK_MOD5_MASK''button1-mask'/'GDK_BUTTON1_MASK''button2-mask'/'GDK_BUTTON2_MASK''button3-mask'/'GDK_BUTTON3_MASK''button4-mask'/'GDK_BUTTON4_MASK''button5-mask'/'GDK_BUTTON5_MASK''super-mask'/'GDK_SUPER_MASK''hyper-mask'/'GDK_HYPER_MASK''meta-mask'/'GDK_META_MASK''release-mask'/'GDK_RELEASE_MASK''modifier-mask'/'GDK_MODIFIER_MASK'
π SEE ALSO π
- Gtk2 β the whole big parent module, go say hi π«Ά
π COPYRIGHT π
Copyright (C) 2003-2011 by the gtk2-perl team.
This software is licensed under the LGPL. See Gtk2 for a full notice. (fr fr, go read it if you need the legal deets π)
and that's the whole page, bestie!! π no notes, ate and left no crumbs. this was generated by perl v5.42.0 and dated 2025-07-25 β mwah π see you in the next manpage π¦β¨
π¦ where this page comes from
- fedora 43: perl-Gtk2 1.24993-23.fc43 Β· LicenseRef-Callaway-LGPLv2+
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms