wailsapp / wails

Create beautiful applications using Go
https://wails.io
MIT License
25.26k stars 1.22k forks source link

[v2] MouseEvent.button returns 1 on back button press #1560

Open kybin opened 2 years ago

kybin commented 2 years ago

Description

window.onclick fired with unwanted MouseEvent.button value on a mouse click.

These are the values I got.

Left: 0 Middle: 1 Right: doesn't fire the event. shows context menu Back: 1

I need 3 for Back button.

To Reproduce

  1. On anywhere in the app.
  2. Back mouse button click.
  3. Got 1 from MouseEvent.button.

Expected behaviour

Get 3 for Back button.

Screenshots

No response

Attempted Fixes

No response

System Details

System
------
OS:     MacOS
Version:    12.4
ID:     199506
Go Version: go1.18.1
Platform:   darwin
Architecture:   amd64

Wails
------
Version:    v2.0.0-beta.38
Revision:   7a634649977241d00abc7e4b7fc4779a6a465923
Modified:   false

Dependency          Package Name    Status      Version
----------          ------------    ------      -------
xcode command line tools    N/A     Installed   2395
npm                 N/A     Installed   8.11.0
*upx                N/A     Available   
*nsis               N/A     Available   

* - Optional Dependency

Additional context

No response

leaanthony commented 2 years ago

I was able to reproduce on Windows but discovered that this worked: https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button - Can you please try that? I've added a guide for it.

leaanthony commented 2 years ago

@kybin - any updates?

kybin commented 2 years ago

Sorry I was away from my computer a while.

Unfortunately it (onmousedown) gives the same result (returns 1) for me.

leaanthony commented 2 years ago

I would recommend looking at any driver or system mappings for your mouse. The Mozilla guide on how to do this absolutely works as intended for me.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.