PadController
Superclasses: EventController
, Object
- Constructors:
PadController(**properties)
new(group:Gio.ActionGroup, pad:Gdk.Device=None) -> Gtk.PadController
Constructors
- class PadController
- classmethod new(group: ActionGroup, pad: Device | None = None) PadController
Creates a new
GtkPadController
that will associate events frompad
to actions.A
None
pad may be provided so the controller manages all pad devices generically, it is discouraged to mixGtkPadController
objects withNone
and non-None
pad
argument on the same toplevel window, as execution order is not guaranteed.The
GtkPadController
is created with no mapped actions. In order to map pad events to actions, useset_action_entries
orset_action
.Be aware that pad events will only be delivered to
GtkWindow
’s, so adding a pad controller to any other type of widget will not have an effect.- Parameters:
group –
GActionGroup
to trigger actions frompad – A
%GDK_SOURCE_TABLET_PAD
device, orNone
to handle all pads
Methods
- class PadController
- set_action(type: PadActionType, index: int, mode: int, label: str, action_name: str) None
Adds an individual action to
controller
.This action will only be activated if the given button/ring/strip number in
index
is interacted while the current mode ismode
. -1 may be used for simple cases, so the action is triggered on all modes.The given
label
should be considered user-visible, so internationalization rules apply. Some windowing systems may be able to use those for user feedback.- Parameters:
type – the type of pad feature that will trigger this action
index – the 0-indexed button/ring/strip number that will trigger this action
mode – the mode that will trigger this action, or -1 for all modes.
label – Human readable description of this action, this string should be deemed user-visible.
action_name – action name that will be activated in the
GActionGroup
- set_action_entries(entries: Sequence[PadActionEntry]) None
A convenience function to add a group of action entries on
controller
.See
PadActionEntry
andset_action
.- Parameters:
entries – the action entries to set on
controller
Properties
- class PadController
- props.action_group: ActionGroup