Dazzle.ShortcutController¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r |
The current context of the controller, for dispatch phase |
||
r |
The current chord for the controller |
||
r/w/en |
The shortcut manager |
||
r/w/co |
The widget for which the controller attached |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
This signal is emitted when the shortcut controller is requesting the widget to reset any state it may have regarding the shortcut controller. |
|
This changes the current context on the |
Fields¶
- Inherited:
Class Details¶
- class Dazzle.ShortcutController(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod find(widget)¶
- Parameters:
widget (
Gtk.Widget
) –- Returns:
An
Dazzle.ShortcutController
orNone
.- Return type:
Finds the registered
Dazzle.ShortcutController
for a widget.The controller is created if it does not already exist.
- classmethod new(widget)¶
- Parameters:
widget (
Gtk.Widget
) –- Return type:
- classmethod try_find(widget)¶
- Parameters:
widget (
Gtk.Widget
) –- Returns:
An
Dazzle.ShortcutController
orNone
.- Return type:
Finds the registered
Dazzle.ShortcutController
for a widget.If no controller is found,
None
is returned.
- add_command_action(command_id, default_accel, phase, action)¶
- Parameters:
command_id (
str
) –default_accel (
str
) –phase (
Dazzle.ShortcutPhase
) –action (
str
) –
- add_command_callback(command_id, default_accel, phase, callback, *callback_data)¶
- Parameters:
command_id (
str
) –default_accel (
str
) –phase (
Dazzle.ShortcutPhase
) –callback (
Gtk.Callback
) –
- execute_command(command)¶
- Parameters:
command (
str
) – the id of the command- Returns:
True
if the command was found and executed.- Return type:
This method will locate and execute the command matching the id command.
If the command is not found,
False
is returned.
- get_context()¶
- Returns:
A
Dazzle.ShortcutContext
orNone
.- Return type:
This function gets the
Dazzle.ShortcutController
:context
property, which is the current context to dispatch events to. AnDazzle.ShortcutContext
is a group of keybindings that may be activated in response to a single or series ofGdk.EventKey
.New in version 3.26.
- get_context_for_phase(phase)¶
- Parameters:
phase (
Dazzle.ShortcutPhase
) – the phase for the shorcut delivery- Returns:
A
Dazzle.ShortcutContext
orNone
.- Return type:
Controllers can have a different context for a particular phase, which allows them to activate different keybindings depending if the event in capture, bubble, or dispatch.
New in version 3.26.
- get_current_chord()¶
- Returns:
A
Dazzle.ShortcutChord
orNone
.- Return type:
This method gets the
Dazzle.ShortcutController
:current-chord
property. This is useful if you want to monitor in-progress chord building.Note that this value will only be valid on the controller for the toplevel widget (a
Gtk.Window
). Chords are not tracked at the individual widget controller level.
- get_manager()¶
- Returns:
- Return type:
Gets the
Dazzle.ShortcutManager
associated with this controller.Generally, this will look for the root controller’s manager as mixing and matching managers in a single window hierarchy is not supported.
- get_widget()¶
- Returns:
the widget for the controller
- Return type:
New in version 3.34.
- remove_accel(accel, phase)¶
- Parameters:
accel (
str
) –phase (
Dazzle.ShortcutPhase
) –
- set_context_by_name(name)¶
-
Changes the context for the controller to the context matching name.
Contexts are resolved at runtime through the current theme (and possibly a parent theme if it inherits from one).
New in version 3.26.
- set_manager(manager)¶
- Parameters:
manager (
Dazzle.ShortcutManager
orNone
) – ADazzle.ShortcutManager
orNone
Sets the
Dazzle.ShortcutController
:manager
property.If you set this to
None
, it will revert to the defaultDazzle.ShortcutManager
for the process.
Signal Details¶
- Dazzle.ShortcutController.signals.reset(shortcut_controller)¶
- Signal Name:
reset
- Flags:
- Parameters:
shortcut_controller (
Dazzle.ShortcutController
) – The object which received the signal
This signal is emitted when the shortcut controller is requesting the widget to reset any state it may have regarding the shortcut controller. Such an example might be a modal system that lives outside the controller whose state should be cleared in response to the controller changing modes.
- Dazzle.ShortcutController.signals.set_context_named(shortcut_controller, name)¶
- Signal Name:
set-context-named
- Flags:
- Parameters:
shortcut_controller (
Dazzle.ShortcutController
) – The object which received the signalname (
str
) – The name of the context
This changes the current context on the
Dazzle.ShortcutController
to be the context matching name. This is found by looking up the context by name in the activeDazzle.ShortcutTheme
.
Property Details¶
- Dazzle.ShortcutController.props.context¶
- Name:
context
- Type:
- Default Value:
- Flags:
The current context of the controller, for dispatch phase
- Dazzle.ShortcutController.props.current_chord¶
- Name:
current-chord
- Type:
- Default Value:
- Flags:
The current chord for the controller
- Dazzle.ShortcutController.props.manager¶
- Name:
manager
- Type:
- Default Value:
- Flags:
The shortcut manager
- Dazzle.ShortcutController.props.widget¶
- Name:
widget
- Type:
- Default Value:
- Flags:
The widget for which the controller attached