Class: Gtk::ShortcutController
- Inherits:
-
EventController
- Object
- EventController
- Gtk::ShortcutController
- Defined in:
- (unknown)
Instance Method Summary collapse
-
#add_shortcut(shortcut) ⇒ nil
Adds shortcut to the list of shortcuts handled by self.
-
#initialize(model) ⇒ Gtk::EventController
constructor
Creates a new shortcut controller that takes its shortcuts from the given list model.
-
#item_type ⇒ GLib::Type
The type of items.
-
#item_type=(item_type) ⇒ GLib::Type
The type of items.
-
#mnemonic_modifiers ⇒ Gdk::ModifierType
The modifiers that need to be pressed to allow mnemonics activation.
-
#mnemonic_modifiers=(mnemonic_modifiers) ⇒ Gdk::ModifierType
The modifiers that need to be pressed to allow mnemonics activation.
-
#mnemonics_modifiers ⇒ Gdk::ModifierType
Gets the mnemonics modifiers for when this controller activates its shortcuts.
-
#mnemonics_modifiers=(modifiers) ⇒ nil
Sets the controller to use the given modifier for mnemonics.
-
#model=(model) ⇒ Gio::ListModel
A list model to take shortcuts from.
-
#n_items ⇒ Integer
The number of items.
-
#n_items=(n_items) ⇒ Integer
The number of items.
-
#remove_shortcut(shortcut) ⇒ nil
Removes shortcut from the list of shortcuts handled by self.
-
#scope ⇒ Gtk::ShortcutScope
What scope the shortcuts will be handled in.
-
#scope=(scope) ⇒ Gtk::ShortcutScope
What scope the shortcuts will be handled in.
Methods inherited from EventController
#current_event, #current_event_device, #current_event_state, #current_event_time, #name, #name=, #propagation_limit, #propagation_limit=, #propagation_phase, #propagation_phase=, #reset, #static_name=, #widget, #widget=
Constructor Details
#initialize(model) ⇒ Gtk::EventController
Creates a new shortcut controller that takes its shortcuts from the given list model.
A controller created by this function does not let you add or remove individual shortcuts using the shortcut controller api, but you can change the contents of the model.
Instance Method Details
#add_shortcut(shortcut) ⇒ nil
Adds shortcut to the list of shortcuts handled by self.
If this controller uses an external shortcut list, this function does nothing.
#item_type ⇒ GLib::Type
The type of items. See [methodGio.ListModel.get_item_type].
#item_type=(item_type) ⇒ GLib::Type
The type of items. See [methodGio.ListModel.get_item_type].
#mnemonic_modifiers ⇒ Gdk::ModifierType
The modifiers that need to be pressed to allow mnemonics activation.
#mnemonic_modifiers=(mnemonic_modifiers) ⇒ Gdk::ModifierType
The modifiers that need to be pressed to allow mnemonics activation.
#mnemonics_modifiers ⇒ Gdk::ModifierType
Gets the mnemonics modifiers for when this controller activates its shortcuts.
#mnemonics_modifiers=(modifiers) ⇒ nil
Sets the controller to use the given modifier for mnemonics.
The mnemonics modifiers determines which modifiers need to be pressed to allow activation of shortcuts with mnemonics triggers.
GTK normally uses the Alt modifier for mnemonics, except in GtkPopoverMenus,
where mnemonics can be triggered without any modifiers. It should be very
rarely necessary to change this, and doing so is likely to interfere with
other shortcuts.
This value is only relevant for local shortcut controllers. Global and managed shortcut controllers will have their shortcuts activated from other places which have their own modifiers for activating mnemonics.
#model=(model) ⇒ Gio::ListModel
A list model to take shortcuts from.
#n_items ⇒ Integer
The number of items. See [methodGio.ListModel.get_n_items].
#n_items=(n_items) ⇒ Integer
The number of items. See [methodGio.ListModel.get_n_items].
#remove_shortcut(shortcut) ⇒ nil
Removes shortcut from the list of shortcuts handled by self.
If shortcut had not been added to controller or this controller uses an external shortcut list, this function does nothing.
#scope ⇒ Gtk::ShortcutScope
What scope the shortcuts will be handled in.
#scope=(scope) ⇒ Gtk::ShortcutScope
What scope the shortcuts will be handled in.