Skip to content

Mouse wheel events during click-drag misdelivered as button events #574

@p-ouellette

Description

@p-ouellette

To reproduce, run the mouse demo, click and drag to start drawing a box, then scroll up or down.
Also, in the micro editor you can't start a selection with click-drag, them scroll with the mouse wheel (you can in vim).

The problem is here:

tcell/tscreen.go

Lines 1247 to 1251 in ede1dd5

if !t.wasbtn {
button = WheelUp
} else {
button = Button1
}

The wasbtn check seems to be there to work around some terminal bug, but I don't know why. If I remove the check and always report a wheel event the mouse demo and scrolling in micro work as expected.

This can also result in wheel events not during a click-drag being reported as button presses if the tcell application spawns another application on a click event. The child app gets the mouse release event and wasbtn never gets reset.

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