Skip to content
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

Support multiple mouse buttons combined #1534

Merged
merged 3 commits into from Nov 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -24,6 +24,7 @@ More detailed release notes can be found on the [releases page](https://github.c
* Menu bar initially doesn't respond to mouse input on macOS (#505)
* iOS: Missing CFBundleIconName and asset catalog (#1504)
* CenterOnScreen causes crash on MacOS when called from goroutine (#1539)
* desktop.MouseHover Button state is not reliable (#1533)
* Initial validation status in widget.Form is not respected


Expand Down
5 changes: 1 addition & 4 deletions driver/desktop/mouse.go
Expand Up @@ -7,10 +7,7 @@ type MouseButton int

const (
// LeftMouseButton is the most common mouse button - on some systems the only one
LeftMouseButton MouseButton = iota + 1

// TODO: Expose this button
// middleMouseButton
LeftMouseButton MouseButton = 1 << iota

// RightMouseButton is the secondary button on most mouse input devices.
RightMouseButton
Expand Down
4 changes: 2 additions & 2 deletions internal/driver/glfw/window.go
Expand Up @@ -682,9 +682,9 @@ func (w *window) mouseClicked(_ *glfw.Window, btn glfw.MouseButton, action glfw.
}

if action == glfw.Press {
w.mouseButton = button
w.mouseButton |= button
} else if action == glfw.Release {
w.mouseButton = 0
w.mouseButton &= ^button
}

if wid, ok := co.(fyne.Draggable); ok {
Expand Down