Skip to content

Tool click method does not work with button=2 #548

@damskii9992

Description

@damskii9992

As the title mentions, this method currently does not seem to do anything when button=2 is used to simulate middle-clicks. Code-snippet to test:

import scipp as sc
import plopp as pp
data_array = sc.DataArray(data=sc.ones(dims=['y', 'x', 't'], shape=[6,6,10]))

def test(rect):
    print(f"deleting rectangle with ID {rect.id}")

figs = pp.inspector(data_array, mode='rectangle', orientation='vertical')
figs[0].toolbar['inspect']._tool.on_change(test)
figs[0].toolbar['inspect']._tool.start()
figs[0].toolbar['inspect']._tool.click(x=1, y=1, button=1)
figs[0].toolbar['inspect']._tool.click(x=5, y=5, button=1)
figs[0].toolbar['inspect']._tool.click(x=3, y=-3, button=2)
figs[0].toolbar['inspect']._tool.stop()
figs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions