Skip to content

Add mouse click action key for right/middle mouse button#1489

Merged
extesy merged 66 commits intoextesy:masterfrom
LiliaDoe:Add-instant-activate-for-right/middle-mouse-button
Dec 15, 2024
Merged

Add mouse click action key for right/middle mouse button#1489
extesy merged 66 commits intoextesy:masterfrom
LiliaDoe:Add-instant-activate-for-right/middle-mouse-button

Conversation

@LiliaDoe
Copy link
Copy Markdown
Contributor

@LiliaDoe LiliaDoe commented Dec 5, 2024

I've tested a majority of the action keys with right click and middle click. Lock works as it did before. If using both click and hold on right click, it's possible to still pull up the context menu on a zoomed image, depending on which action keys are set to right click.

@LiliaDoe
Copy link
Copy Markdown
Contributor Author

LiliaDoe commented Dec 14, 2024

I went through and tested what I could think of. More testing is always appreciated, but what I've tested and checked work as expected now.

  • I had redo how it used preventDefault() so right and middle click wouldn't affect each other.
  • Right click to lock image definitely works now.
  • Middle click preventDefault() works too
  • Fixed options not saving initially, requiring the button be pressed twice
  • Having middle and right click actions also works. E.g. activate on middle click hold and holding right click to zoom works as intended
  • Added an option for users to define how long they need to hold before hold action activates. Also defines how quick they have to click the button. E.g. 250ms hold time means they have to press and release the button within 250ms for it to be a click and not a hold action

@LiliaDoe LiliaDoe marked this pull request as ready for review December 14, 2024 22:44
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
18.9% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@extesy
Copy link
Copy Markdown
Owner

extesy commented Dec 15, 2024

Since I just pushed a release and won't be doing new releases until 2025, I'm going to just merge this PR as-is and let it bake for 2-3 weeks. It will give us enough time for testing, and if you discover any new issues in the meantime, feel free to create follow-up PRs with fixes.

@extesy extesy merged commit 972b513 into extesy:master Dec 15, 2024
@LiliaDoe LiliaDoe deleted the Add-instant-activate-for-right/middle-mouse-button branch December 15, 2024 04:03
@extesy
Copy link
Copy Markdown
Owner

extesy commented Dec 28, 2024

@LiliaDoe There is a bug introduced in this PR. Hoverzoom shows the image even if the cursor moved past the link while the image was being prepared. This is extremely annoying because if for example I move the cursor across the page and it accidentally crosses some image link, it will be zoomed even if I don't keep the cursor on top of that link. Can you please take a look? Otherwise I'll have to revert this PR until the problem is resolved.

@LiliaDoe
Copy link
Copy Markdown
Contributor Author

LiliaDoe commented Dec 28, 2024

@extesy I'll take a look at it. Are you using any mouse buttons as action keys when this happens?

@extesy
Copy link
Copy Markdown
Owner

extesy commented Dec 28, 2024

No keys, purely a mouse movement.

@LiliaDoe
Copy link
Copy Markdown
Contributor Author

I'm not sure what would be causing it in this PR. What you're describing happens to me once in a while, but it's very inconsistent. Does the image disappear again when you click? I have a PR that reverts most of the action key changes from this PR which may be the cause of the bug.

@LiliaDoe LiliaDoe restored the Add-instant-activate-for-right/middle-mouse-button branch December 30, 2024 23:51
@LiliaDoe LiliaDoe deleted the Add-instant-activate-for-right/middle-mouse-button branch December 31, 2024 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants