rust_minifb icon indicating copy to clipboard operation
rust_minifb copied to clipboard

Add back and forward mouse buttons

Open nimad499 opened this issue 7 months ago • 7 comments

This PR adds support for back and forward mouse buttons.

I've tested it and confirmed that it works correctly on POSIX (X11/Wayland), Windows, and WebAssembly.

Regarding macOS, I wrote the implementation based on existing code and some research, but I haven't been able to test it. It would be great if someone could verify whether it works as expected.

As for Redox, it appears that the underlying library does not support these buttons. Therefore, there's nothing that can be done at the moment. I've added match arms for completeness and used the unimplemented! macro to handle those cases.

nimad499 avatar May 25 '25 15:05 nimad499

This should work for now. The only thing I can't figure out is why it doesn't work in Firefox at all. Even in plain JavaScript, it doesn't seem to work, so it looks like the issue is specific to Firefox.

Also, to support capturing all buttons at the same time, I’ll work on replacing MouseEvent.button with MouseEvent.buttons.

nimad499 avatar May 25 '25 17:05 nimad499

Thanks!

I’ll work on replacing MouseEvent.button with MouseEvent.buttons

Do you want to do this in this PR or do you want to do it in a separate PR?

emoon avatar May 25 '25 17:05 emoon

I think it's not related to the current PR, so it would be logical to include it in another PR. But as you wish.

nimad499 avatar May 25 '25 18:05 nimad499

I'm totally fine with having it in a separate PR :)

emoon avatar May 26 '25 10:05 emoon

Just making sure: Are you happy with this PR so I can merge it now?

emoon avatar May 27 '25 12:05 emoon

I tested it on all platforms except macOS. I don't have access to a Mac to verify it. Other than that everything else works fine.

nimad499 avatar May 27 '25 12:05 nimad499

I can test it on macOS first (I will do it after work today and get back to you)

emoon avatar May 27 '25 12:05 emoon

Any updates on this?

Chubercik avatar Oct 29 '25 12:10 Chubercik

Oh shit! I totally forgot about this! I will get it sorted tomorrow

emoon avatar Oct 29 '25 16:10 emoon

I have tested now and it works just fine! Thank again.

emoon avatar Oct 31 '25 14:10 emoon