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 1 commit
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 @@ -21,6 +21,7 @@ More detailed release notes can be found on the [releases page](https://github.c
* Entry copy/paste is crashing on android 7.1 (#1511)
* Fyne package creating invalid windows packages (#1521)
* Menu bar initially doesn't respond to mouse input on macOS (#505)
* desktop.MouseHover Button state is not reliable (#1533)


## 1.4 - 1 November 2020
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