Skip to content

Bug: Qt mouse button MouseButton.MiddleButton is unknown #143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
tlambert03 opened this issue Feb 25, 2025 · 0 comments
Open

Bug: Qt mouse button MouseButton.MiddleButton is unknown #143

tlambert03 opened this issue Feb 25, 2025 · 0 comments

Comments

@tlambert03
Copy link
Member


│ /Users/talley/dev/self/ndv/src/ndv/views/_qt/_app.py:107 in mouse_btn        │
│                                                                              │
│   104 │   │   if btn == Qt.MouseButton.NoButton:                             │
│   105 │   │   │   return MouseButton.NONE                                    │
│   106 │   │                                                                  │
│ ❱ 107 │   │   raise Exception(f"Qt mouse button {btn} is unknown")           │
│   108 │                                                                      │
│   109 │   def set_cursor(self, type: CursorType) -> None:                    │
│   110 │   │   self.canvas.setCursor(type.to_qt())                            │
╰──────────────────────────────────────────────────────────────────────────────╯
Exception: Qt mouse button MouseButton.MiddleButton is unknown

just accidentally hit my middle mouse button and got an exception. In this case, it's easy enough to just map to MouseButton.MIDDLE, but more generally we should just fail silently if a mouse button we don't particularly care about is pressed (it shouldn't be an exception)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant