:right-sidebar: True ShortcutsShortcut =================================================================== .. currentmodule:: gi.repository.Gtk .. class:: ShortcutsShortcut(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gtk.Widget`, :class:`~gi.repository.GObject.InitiallyUnowned`, :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gtk.Accessible`, :class:`~gi.repository.Gtk.Buildable`, :class:`~gi.repository.Gtk.ConstraintTarget` A ``GtkShortcutsShortcut`` represents a single keyboard shortcut or gesture with a short text. This widget is only meant to be used with ``GtkShortcutsWindow``. Properties ---------- .. rst-class:: interim-class .. class:: ShortcutsShortcut :no-index: .. attribute:: props.accel_size_group :type: ~gi.repository.Gtk.SizeGroup The size group for the accelerator portion of this shortcut. This is used internally by GTK, and must not be modified by applications. .. attribute:: props.accelerator :type: str The accelerator(s) represented by this object. This property is used if :obj:`~gi.repository.Gtk.ShortcutsShortcut.props.shortcut_type` is set to :const:`~gi.repository.Gtk.ShortcutType.ACCELERATOR`. The syntax of this property is (an extension of) the syntax understood by :obj:`~gi.repository.Gtk.accelerator_parse`. Multiple accelerators can be specified by separating them with a space, but keep in mind that the available width is limited. It is also possible to specify ranges of shortcuts, using ``...`` between the keys. Sequences of keys can be specified using a ``+`` or ``&`` between the keys. Examples: - A single shortcut: ``delete`` - Two alternative shortcuts: `a Home` - A range of shortcuts: ``1...9`` - Several keys pressed together: ``Control_L&Control_R`` - A sequence of shortcuts or keys: ``c+x`` Use "+" instead of "&" when the keys may (or have to be) pressed sequentially (e.g use "t+t" for 'press the t key twice'). Note that ``<``, ``>`` and ``&`` need to be escaped as ``<``, ``>``; and ``&``; when used in .ui files. .. attribute:: props.action_name :type: str A detailed action name. If this is set for a shortcut of type :const:`~gi.repository.Gtk.ShortcutType.ACCELERATOR`, then GTK will use the accelerators that are associated with the action via :obj:`~gi.repository.Gtk.Application.set_accels_for_action`, and setting :obj:`~gi.repository.Gtk.ShortcutsShortcut.props.accelerator` is not necessary. .. attribute:: props.direction :type: ~gi.repository.Gtk.TextDirection The text direction for which this shortcut is active. If the shortcut is used regardless of the text direction, set this property to :const:`~gi.repository.Gtk.TextDirection.NONE`. .. attribute:: props.icon :type: ~gi.repository.Gio.Icon An icon to represent the shortcut or gesture. This property is used if :obj:`~gi.repository.Gtk.ShortcutsShortcut.props.shortcut_type` is set to :const:`~gi.repository.Gtk.ShortcutType.GESTURE`. For the other predefined gesture types, GTK provides an icon on its own. .. attribute:: props.icon_set :type: bool :const:`True` if an icon has been set. .. attribute:: props.shortcut_type :type: ~gi.repository.Gtk.ShortcutType The type of shortcut that is represented. .. attribute:: props.subtitle :type: str The subtitle for the shortcut or gesture. This is typically used for gestures and should be a short, one-line text that describes the gesture itself. For the predefined gesture types, GTK provides a subtitle on its own. .. attribute:: props.subtitle_set :type: bool :const:`True` if a subtitle has been set. .. attribute:: props.title :type: str The textual description for the shortcut or gesture represented by this object. This should be a short string that can fit in a single line. .. attribute:: props.title_size_group :type: ~gi.repository.Gtk.SizeGroup The size group for the textual portion of this shortcut. This is used internally by GTK, and must not be modified by applications.