Skip to content

Commit

Permalink
Merge pull request #1534 from andydotxyz/fix/1533
Browse files Browse the repository at this point in the history
Support multiple mouse buttons combined
  • Loading branch information
andydotxyz committed Nov 16, 2020
2 parents 96c38fb + 0e65e1c commit ab52462
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
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

0 comments on commit ab52462

Please sign in to comment.