<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version SYSTEM "version.xml">
<!ENTITY pi "&#960;">
<!ENTITY solidus "&#8260;">
]>
<refentry id="GtkShortcut">
<refmeta>
<refentrytitle role="top_of_page" id="GtkShortcut.top_of_page">GtkShortcut</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK4 Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GtkShortcut</refname>
<refpurpose>An object describing a keyboard shortcut</refpurpose>
</refnamediv>

<refsect1 id="GtkShortcut.functions" role="functions_proto">
<title role="functions_proto.title">Functions</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="functions_proto_type" colwidth="150px"/>
<colspec colname="functions_proto_name"/>
<tbody>
<row><entry role="function_type"><link linkend="GtkShortcut"><returnvalue>GtkShortcut</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-shortcut-new">gtk_shortcut_new</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GtkShortcut"><returnvalue>GtkShortcut</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-shortcut-new-with-arguments">gtk_shortcut_new_with_arguments</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GtkShortcutTrigger"><returnvalue>GtkShortcutTrigger</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-shortcut-get-trigger">gtk_shortcut_get_trigger</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-shortcut-set-trigger">gtk_shortcut_set_trigger</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GtkShortcutAction"><returnvalue>GtkShortcutAction</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-shortcut-get-action">gtk_shortcut_get_action</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-shortcut-set-action">gtk_shortcut_set_action</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GVariant"><returnvalue>GVariant</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-shortcut-get-arguments">gtk_shortcut_get_arguments</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-shortcut-set-arguments">gtk_shortcut_set_arguments</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkShortcut.properties" role="properties">
<title role="properties.title">Properties</title>
<informaltable frame="none">
<tgroup cols="3">
<colspec colname="properties_type" colwidth="150px"/>
<colspec colname="properties_name" colwidth="300px"/>
<colspec colname="properties_flags" colwidth="200px"/>
<tbody>
<row><entry role="property_type"><link linkend="GtkShortcutAction"><type>GtkShortcutAction</type></link>&#160;*</entry><entry role="property_name"><link linkend="GtkShortcut--action">action</link></entry><entry role="property_flags">Read / Write</entry></row>
<row><entry role="property_type"><link linkend="GVariant"><type>GVariant</type></link>&#160;*</entry><entry role="property_name"><link linkend="GtkShortcut--arguments">arguments</link></entry><entry role="property_flags">Read / Write</entry></row>
<row><entry role="property_type"><link linkend="GtkShortcutTrigger"><type>GtkShortcutTrigger</type></link>&#160;*</entry><entry role="property_name"><link linkend="GtkShortcut--trigger">trigger</link></entry><entry role="property_flags">Read / Write</entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkShortcut.other" role="other_proto">
<title role="other_proto.title">Types and Values</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="other_proto_type" colwidth="150px"/>
<colspec colname="other_proto_name"/>
<tbody>
<row><entry role="datatype_keyword"></entry><entry role="function_name"><link linkend="GtkShortcut-struct">GtkShortcut</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkShortcut.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<screen>    <link linkend="GObject">GObject</link>
    <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> GtkShortcut
</screen>
</refsect1>

<refsect1 id="GtkShortcut.includes"><title>Includes</title><synopsis>#include &lt;gtk/gtk.h&gt;
</synopsis></refsect1>

<refsect1 id="GtkShortcut.description" role="desc">
<title role="desc.title">Description</title>
<para>GtkShortcut is the low level object used for managing keyboard
shortcuts.</para>
<para>It contains a description of how to trigger the shortcut via a
<link linkend="GtkShortcutTrigger"><type>GtkShortcutTrigger</type></link> and a way to activate the shortcut on a widget
via <link linkend="GtkShortcutAction"><type>GtkShortcutAction</type></link>.</para>
<para>The actual work is usually done via <link linkend="GtkShortcutController"><type>GtkShortcutController</type></link>, which
decides if and when to activate a shortcut. Using that controller
directly however is rarely necessary as various higher level
convenience APIs exist on <link linkend="GtkWidgets"><type>GtkWidgets</type></link> that make it easier to use
shortcuts in GTK.</para>
<para><link linkend="GtkShortcut"><type>GtkShortcut</type></link> does provide functionality to make it easy for users
to work with shortcuts, either by providing informational strings
for display purposes or by allowing shortcuts to be configured.</para>

</refsect1>
<refsect1 id="GtkShortcut.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="gtk-shortcut-new" role="function">
<title>gtk_shortcut_new&#160;()</title>
<indexterm zone="gtk-shortcut-new"><primary>gtk_shortcut_new</primary></indexterm>
<programlisting language="C"><link linkend="GtkShortcut"><returnvalue>GtkShortcut</returnvalue></link>&#160;*
gtk_shortcut_new (<parameter><link linkend="GtkShortcutTrigger"><type>GtkShortcutTrigger</type></link> *trigger</parameter>,
                  <parameter><link linkend="GtkShortcutAction"><type>GtkShortcutAction</type></link> *action</parameter>);</programlisting>
<para>Creates a new <link linkend="GtkShortcut"><type>GtkShortcut</type></link> that is triggered by <parameter>trigger</parameter>
 and then activates
<parameter>action</parameter>
.</para>
<refsect3 id="gtk-shortcut-new.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>trigger</para></entry>
<entry role="parameter_description"><para>The trigger that will trigger the shortcut. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>transfer full</acronym>][<acronym>nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>action</para></entry>
<entry role="parameter_description"><para>The action that will be activated upon
triggering. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>transfer full</acronym>][<acronym>nullable</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-shortcut-new.returns" role="returns">
<title>Returns</title>
<para> a new <link linkend="GtkShortcut"><type>GtkShortcut</type></link></para>
</refsect3></refsect2>
<refsect2 id="gtk-shortcut-new-with-arguments" role="function">
<title>gtk_shortcut_new_with_arguments&#160;()</title>
<indexterm zone="gtk-shortcut-new-with-arguments"><primary>gtk_shortcut_new_with_arguments</primary></indexterm>
<programlisting language="C"><link linkend="GtkShortcut"><returnvalue>GtkShortcut</returnvalue></link>&#160;*
gtk_shortcut_new_with_arguments (<parameter><link linkend="GtkShortcutTrigger"><type>GtkShortcutTrigger</type></link> *trigger</parameter>,
                                 <parameter><link linkend="GtkShortcutAction"><type>GtkShortcutAction</type></link> *action</parameter>,
                                 <parameter>const <link linkend="gchar"><type>gchar</type></link> *format_string</parameter>,
                                 <parameter>...</parameter>);</programlisting>
<para>Creates a new <link linkend="GtkShortcut"><type>GtkShortcut</type></link> that is triggered by <parameter>trigger</parameter>
 and then activates
<parameter>action</parameter>
 with arguments given by <parameter>format_string</parameter>
.</para>

<para><emphasis role="annotation">[<acronym>skip</acronym>]</emphasis></para><refsect3 id="gtk-shortcut-new-with-arguments.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>trigger</para></entry>
<entry role="parameter_description"><para>The trigger that will trigger the shortcut. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>transfer full</acronym>][<acronym>nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>action</para></entry>
<entry role="parameter_description"><para>The action that will be activated upon
triggering. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>transfer full</acronym>][<acronym>nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>format_string</para></entry>
<entry role="parameter_description"><para>GVariant format string for arguments or <link linkend="NULL:CAPS"><literal>NULL</literal></link> for
no arguments. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>allow-none</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>...</para></entry>
<entry role="parameter_description"><para>arguments, as given by format string.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-shortcut-new-with-arguments.returns" role="returns">
<title>Returns</title>
<para> a new <link linkend="GtkShortcut"><type>GtkShortcut</type></link></para>
</refsect3></refsect2>
<refsect2 id="gtk-shortcut-get-trigger" role="function">
<title>gtk_shortcut_get_trigger&#160;()</title>
<indexterm zone="gtk-shortcut-get-trigger"><primary>gtk_shortcut_get_trigger</primary></indexterm>
<programlisting language="C"><link linkend="GtkShortcutTrigger"><returnvalue>GtkShortcutTrigger</returnvalue></link>&#160;*
gtk_shortcut_get_trigger (<parameter><link linkend="GtkShortcut"><type>GtkShortcut</type></link> *self</parameter>);</programlisting>
<para>Gets the trigger used to trigger <parameter>self</parameter>
.</para>
<refsect3 id="gtk-shortcut-get-trigger.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkShortcut"><type>GtkShortcut</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-shortcut-get-trigger.returns" role="returns">
<title>Returns</title>
<para>the trigger used. </para>
<para><emphasis role="annotation">[<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-shortcut-set-trigger" role="function">
<title>gtk_shortcut_set_trigger&#160;()</title>
<indexterm zone="gtk-shortcut-set-trigger"><primary>gtk_shortcut_set_trigger</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_shortcut_set_trigger (<parameter><link linkend="GtkShortcut"><type>GtkShortcut</type></link> *self</parameter>,
                          <parameter><link linkend="GtkShortcutTrigger"><type>GtkShortcutTrigger</type></link> *trigger</parameter>);</programlisting>
<para>Sets the new trigger for <parameter>self</parameter>
 to be <parameter>trigger</parameter>
.</para>
<refsect3 id="gtk-shortcut-set-trigger.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkShortcut"><type>GtkShortcut</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>trigger</para></entry>
<entry role="parameter_description"><para>The new trigger.
If the <parameter>trigger</parameter>
is <link linkend="NULL:CAPS"><literal>NULL</literal></link>, the never trigger will be used. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>transfer full</acronym>][<acronym>nullable</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-shortcut-get-action" role="function">
<title>gtk_shortcut_get_action&#160;()</title>
<indexterm zone="gtk-shortcut-get-action"><primary>gtk_shortcut_get_action</primary></indexterm>
<programlisting language="C"><link linkend="GtkShortcutAction"><returnvalue>GtkShortcutAction</returnvalue></link>&#160;*
gtk_shortcut_get_action (<parameter><link linkend="GtkShortcut"><type>GtkShortcut</type></link> *self</parameter>);</programlisting>
<para>Gets the action that is activated by this shortcut.</para>
<refsect3 id="gtk-shortcut-get-action.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkShortcut"><type>GtkShortcut</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-shortcut-get-action.returns" role="returns">
<title>Returns</title>
<para>the action. </para>
<para><emphasis role="annotation">[<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-shortcut-set-action" role="function">
<title>gtk_shortcut_set_action&#160;()</title>
<indexterm zone="gtk-shortcut-set-action"><primary>gtk_shortcut_set_action</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_shortcut_set_action (<parameter><link linkend="GtkShortcut"><type>GtkShortcut</type></link> *self</parameter>,
                         <parameter><link linkend="GtkShortcutAction"><type>GtkShortcutAction</type></link> *action</parameter>);</programlisting>
<para>Sets the new action for <parameter>self</parameter>
 to be <parameter>action</parameter>
.</para>
<refsect3 id="gtk-shortcut-set-action.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkShortcut"><type>GtkShortcut</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>action</para></entry>
<entry role="parameter_description"><para>The new action.
If the <parameter>action</parameter>
is <link linkend="NULL:CAPS"><literal>NULL</literal></link>, the nothing action will be used. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>transfer full</acronym>][<acronym>nullable</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-shortcut-get-arguments" role="function">
<title>gtk_shortcut_get_arguments&#160;()</title>
<indexterm zone="gtk-shortcut-get-arguments"><primary>gtk_shortcut_get_arguments</primary></indexterm>
<programlisting language="C"><link linkend="GVariant"><returnvalue>GVariant</returnvalue></link>&#160;*
gtk_shortcut_get_arguments (<parameter><link linkend="GtkShortcut"><type>GtkShortcut</type></link> *self</parameter>);</programlisting>
<para>Gets the arguments that are passed when activating the shortcut.</para>
<refsect3 id="gtk-shortcut-get-arguments.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkShortcut"><type>GtkShortcut</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-shortcut-get-arguments.returns" role="returns">
<title>Returns</title>
<para>the arguments. </para>
<para><emphasis role="annotation">[<acronym>transfer none</acronym>][<acronym>nullable</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-shortcut-set-arguments" role="function">
<title>gtk_shortcut_set_arguments&#160;()</title>
<indexterm zone="gtk-shortcut-set-arguments"><primary>gtk_shortcut_set_arguments</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_shortcut_set_arguments (<parameter><link linkend="GtkShortcut"><type>GtkShortcut</type></link> *self</parameter>,
                            <parameter><link linkend="GVariant"><type>GVariant</type></link> *args</parameter>);</programlisting>
<para>Sets the arguments to pass when activating the shortcut.</para>
<refsect3 id="gtk-shortcut-set-arguments.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkShortcut"><type>GtkShortcut</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>args</para></entry>
<entry role="parameter_description"><para>arguments to pass when activating <parameter>self</parameter>
. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>

</refsect1>
<refsect1 id="GtkShortcut.other_details" role="details">
<title role="details.title">Types and Values</title>
<refsect2 id="GtkShortcut-struct" role="struct">
<title>GtkShortcut</title>
<indexterm zone="GtkShortcut-struct"><primary>GtkShortcut</primary></indexterm>
<programlisting language="C">typedef struct _GtkShortcut GtkShortcut;</programlisting>
</refsect2>

</refsect1>
<refsect1 id="GtkShortcut.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GtkShortcut--action" role="property"><title>The <literal>“action”</literal> property</title>
<indexterm zone="GtkShortcut--action"><primary>GtkShortcut:action</primary></indexterm>
<programlisting>  “action”                   <link linkend="GtkShortcutAction"><type>GtkShortcutAction</type></link>&#160;*</programlisting>
<para>The action that gets activated by this shortcut.</para>
<para>Owner: GtkShortcut</para>
<para>Flags: Read / Write</para>
</refsect2>
<refsect2 id="GtkShortcut--arguments" role="property"><title>The <literal>“arguments”</literal> property</title>
<indexterm zone="GtkShortcut--arguments"><primary>GtkShortcut:arguments</primary></indexterm>
<programlisting>  “arguments”                <link linkend="GVariant"><type>GVariant</type></link>&#160;*</programlisting>
<para>Arguments passed to activation.</para>
<para>Owner: GtkShortcut</para>
<para>Flags: Read / Write</para>
<para>Allowed values: GVariant&lt;*&gt;</para>
<para>Default value: NULL</para>
</refsect2>
<refsect2 id="GtkShortcut--trigger" role="property"><title>The <literal>“trigger”</literal> property</title>
<indexterm zone="GtkShortcut--trigger"><primary>GtkShortcut:trigger</primary></indexterm>
<programlisting>  “trigger”                  <link linkend="GtkShortcutTrigger"><type>GtkShortcutTrigger</type></link>&#160;*</programlisting>
<para>The trigger that triggers this shortcut.</para>
<para>Owner: GtkShortcut</para>
<para>Flags: Read / Write</para>
</refsect2>

</refsect1>
<refsect1 id="GtkShortcut.see-also">
<title>See Also</title>
<para><link linkend="GtkShortcutController"><type>GtkShortcutController</type></link>, <link linkend="GtkShortcutAction"><type>GtkShortcutAction</type></link>,
<link linkend="GtkShortcutTrigger"><type>GtkShortcutTrigger</type></link></para>

</refsect1>

</refentry>
