Skip to content

MouseEvent buttons attribute breaks under certain circumstances #2709

@t-wallet

Description

@t-wallet

We have observed that the buttons attribute of the MouseEvent class is wrong under certain circumstances. Currently the MousePress and MouseRelease events are used to record which mouse buttons are pressed. But a mouse press is not always followed by a corresponding mouse release (at least when using the Qt6 backend). This goes wrong in the following scenario:

  • Press LMB on the vispy canvas
  • Modal dialog pops up
  • Release LMB while the modal dialog is in focus
  • Vispy canvas never receives the MouseRelease event and therefore will still record LMB as being pressed.

In t-wallet@1a7b091 I fixed this for the Qt6 backend by using the buttons() function on the native Qt event, so that can be used as a reference.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions