Skip to content

Pointer.output_name: Provide setter #219

@heuer

Description

@heuer

Pointer.output_name is a read-only property, but it should be changeable.

This becomes handy if a virtual pointer event (see #217) provides a suggested output:

def on_virtual_pointer(listener, event: VirtualPointerV1NewPointerEvent):
    pointer = Pointer.from_input_device(event.new_pointer.pointer.base)
    if output := event.suggested_output:
        pointer.output_name = output.name
    # […]
    attach_input_to_output(pointer)

def attach_input_to_output(device: Pointer | Touch):
    if output_name := device.output_name:
        output = find_output_by_name(output_name)
        cursor.map_input_to_output(device.base, output)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions