CtkShortcutsShortcut: CTK+ 3 Reference Manual

## CtkShortcutsShortcut CtkShortcutsShortcut — Represents a keyboard shortcut in a CtkShortcutsWindow |

## Properties

CtkSizeGroup * | accel-size-group | Write
char * | accelerator | Read / Write
char * | action-name | Read / Write
CtkTextDirection | direction | Read / Write
GIcon * | icon | Read / Write
gboolean | icon-set | Read / Write
CtkShortcutType | shortcut-type | Read / Write
char * | subtitle | Read / Write
gboolean | subtitle-set | Read / Write
char * | title | Read / Write
CtkSizeGroup * | title-size-group | Write

## Types and Values

| CtkShortcutsShortcut
enum | CtkShortcutType

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── CtkWidget
                ╰── CtkContainer
                    ╰── CtkBox
                        ╰── CtkShortcutsShortcut

## Implemented Interfaces

CtkShortcutsShortcut implements AtkImplementorIface, CtkBuildable and CtkOrientable.

## Includes

    #include <ctk/ctk.h>

## Description

A CtkShortcutsShortcut represents a single keyboard shortcut or gesture with a short text. This widget is only meant to be used with CtkShortcutsWindow.

## Functions

## Types and Values

### CtkShortcutsShortcut

    typedef struct _CtkShortcutsShortcut CtkShortcutsShortcut;

### enum CtkShortcutType

CtkShortcutType specifies the kind of shortcut that is being described. More values may be added to this enumeration over time.

#### Members

CTK_SHORTCUT_ACCELERATOR | The shortcut is a keyboard accelerator. The “accelerator” property will be used. |
CTK_SHORTCUT_GESTURE_PINCH | The shortcut is a pinch gesture. CTK+ provides an icon and subtitle. |
CTK_SHORTCUT_GESTURE_STRETCH | The shortcut is a stretch gesture. CTK+ provides an icon and subtitle. |
CTK_SHORTCUT_GESTURE_ROTATE_CLOCKWISE | The shortcut is a clockwise rotation gesture. CTK+ provides an icon and subtitle. |
CTK_SHORTCUT_GESTURE_ROTATE_COUNTERCLOCKWISE | The shortcut is a counterclockwise rotation gesture. CTK+ provides an icon and subtitle. |
CTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_LEFT | The shortcut is a two-finger swipe gesture. CTK+ provides an icon and subtitle. |
CTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_RIGHT | The shortcut is a two-finger swipe gesture. CTK+ provides an icon and subtitle. |
CTK_SHORTCUT_GESTURE | The shortcut is a gesture. The “icon” property will be used. |

Since: 3.20

## Property Details

### The `“accel-size-group”` property

      “accel-size-group”         CtkSizeGroup *

The size group for the accelerator portion of this shortcut.

This is used internally by CTK+, and must not be modified by applications.

Owner: CtkShortcutsShortcut

Flags: Write

### The `“accelerator”` property

      “accelerator”              char *

The accelerator(s) represented by this object. This property is used if “shortcut-type” is set to CTK_SHORTCUT_ACCELERATOR.

The syntax of this property is (an extension of) the syntax understood by `ctk_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: <ctl><alt>delete

- Two alternative shortcuts: <shift>a Home

- A range of shortcuts: <alt>1...<alt>9

- Several keys pressed together: Control_L&Control_R

- A sequence of shortcuts or keys: <ctl>c+<ctl>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.

Owner: CtkShortcutsShortcut

Flags: Read / Write

Default value: NULL

### The `“action-name”` property

      “action-name”              char *

A detailed action name. If this is set for a shortcut of type `CTK_SHORTCUT_ACCELERATOR`, then CTK+ will use the accelerators that are associated with the action via `ctk_application_set_accels_for_action()`, and setting “accelerator” is not necessary.

Owner: CtkShortcutsShortcut

Flags: Read / Write

Default value: NULL

Since: 3.22

### The `“direction”` property

      “direction”                CtkTextDirection

The text direction for which this shortcut is active. If the shortcut is used regardless of the text direction, set this property to CTK_TEXT_DIR_NONE.

Owner: CtkShortcutsShortcut

Flags: Read / Write

Default value: CTK_TEXT_DIR_NONE

### The `“icon”` property

      “icon”                     GIcon *

An icon to represent the shortcut or gesture. This property is used if “shortcut-type” is set to CTK_SHORTCUT_GESTURE. For the other predefined gesture types, CTK+ provides an icon on its own.

Owner: CtkShortcutsShortcut

Flags: Read / Write

### The `“icon-set”` property

      “icon-set”                 gboolean

`TRUE` if an icon has been set.

Owner: CtkShortcutsShortcut

Flags: Read / Write

Default value: FALSE

### The `“shortcut-type”` property

      “shortcut-type”            CtkShortcutType

The type of shortcut that is represented.

Owner: CtkShortcutsShortcut

Flags: Read / Write

Default value: CTK_SHORTCUT_ACCELERATOR

### The `“subtitle”` property

      “subtitle”                 char *

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, CTK+ provides a subtitle on its own.

Owner: CtkShortcutsShortcut

Flags: Read / Write

Default value: ""

### The `“subtitle-set”` property

      “subtitle-set”             gboolean

`TRUE` if a subtitle has been set.

Owner: CtkShortcutsShortcut

Flags: Read / Write

Default value: FALSE

### The `“title”` property

      “title”                    char *

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.

Owner: CtkShortcutsShortcut

Flags: Read / Write

Default value: ""

### The `“title-size-group”` property

      “title-size-group”         CtkSizeGroup *

The size group for the textual portion of this shortcut.

This is used internally by CTK+, and must not be modified by applications.

Owner: CtkShortcutsShortcut

Flags: Write