Update mouse-buttons.mdx

This commit is contained in:
Lea Anthony
2022-07-14 22:27:48 +10:00
committed by GitHub
parent 5987f17cca
commit 931913a1d3
+3 -2
View File
@@ -1,7 +1,8 @@
# Mouse Buttons
The Wails runtime intercepts mouse clicks to determine whether a frameless window needs resizing or a window needs to be moved.
It has been asked how to detect when a mouse click has occurred. The following code shows how to detect mouse clicks:
It has been asked how to detect when a mouse click has occurred, because `window.onclick` doesn't report the mouse buttons correctly.
The following code shows how to detect mouse clicks:
```javascript
@@ -24,4 +25,4 @@ function handleMouseButtonDown(event) {
}
```
Reference: https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button
Reference: https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button