slint.language

class KeyboardModifiers(builtins.tuple):

The KeyboardModifiers struct provides booleans to indicate possible modifier keys on a keyboard, such as Shift, Control, etc. It is provided as part of KeyEvent's modifiers field.

Keyboard shortcuts on Apple platforms typically use the Command key (⌘), such as Command+C for "Copy". On other platforms the same shortcut is typically represented using Control+C. To make it easier to develop cross-platform applications, on macOS, Slint maps the Command key to the control modifier, and the Control key to the meta modifier.

On Windows, the Windows key is mapped to the meta modifier.

KeyboardModifiers( alt: bool = False, control: bool = False, shift: bool = False, meta: bool = False)

Create new instance of KeyboardModifiers(alt, control, shift, meta)

alt: bool

Indicates the Alt key on a keyboard.

control: bool

Indicates the Control key on a keyboard, except on macOS, where it is the Command key (⌘).

shift: bool

Indicates the Shift key on a keyboard.

meta: bool

Indicates the Control key on macos, and the Windows key on Windows.

class PointerEvent(builtins.tuple):

Represents a Pointer event sent by the windowing system. This structure is passed to the pointer-event callback of the TouchArea element.

PointerEvent( button: Any = None, kind: Any = None, modifiers: Any = None, touch_finger_id: int = 0)

Create new instance of PointerEvent(button, kind, modifiers, touch_finger_id)

button: Any

The button that was pressed or released

kind: Any

The kind of the event

modifiers: Any

The keyboard modifiers pressed during the event

touch_finger_id: int

The unique ID of the touch point, indicating the finger ID. 0 means it's not a touch event (e.g., mouse).

class PointerScrollEvent(builtins.tuple):

Represents a Pointer scroll (or wheel) event sent by the windowing system. This structure is passed to the scroll-event callback of the TouchArea element.

PointerScrollEvent(delta_x: float = 0.0, delta_y: float = 0.0, modifiers: Any = None)

Create new instance of PointerScrollEvent(delta_x, delta_y, modifiers)

delta_x: float

The amount of pixel in the horizontal direction

delta_y: float

The amount of pixel in the vertical direction

modifiers: Any

The keyboard modifiers pressed during the event

class KeyEvent(builtins.tuple):

This structure is generated and passed to the key press and release callbacks of the FocusScope element.

KeyEvent(text: str = '', modifiers: Any = None, repeat: bool = False)

Create new instance of KeyEvent(text, modifiers, repeat)

text: str

The unicode representation of the key pressed.

modifiers: Any

The keyboard modifiers active at the time of the key press event.

repeat: bool

This field is set to true for key press events that are repeated, i.e. the key is held down. It's always false for key release events.

class StandardListViewItem(builtins.tuple):

Represents an item in a StandardListView and a StandardTableView.

StandardListViewItem(text: str = '')

Create new instance of StandardListViewItem(text,)

text: str

The text content of the item