Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pressing media key play/pause scrolls to top of the page #3317

Closed
Dave562CZ opened this issue May 11, 2019 · 7 comments
Closed

Pressing media key play/pause scrolls to top of the page #3317

Dave562CZ opened this issue May 11, 2019 · 7 comments

Comments

@Dave562CZ
Copy link

When I press play/pause media key. Current page scrolls up to the top.
It scroll only during pause not unpause.
I could not find any settings which would prevent this in config.
It does not happen when i disable Vimium on that page.

@Dave562CZ
Copy link
Author

Anybody has idea how to prevent this from happening?

@gdh1995
Copy link
Contributor

gdh1995 commented Aug 27, 2020

Can not find the reason directly. Please open https://gdh1995.cn/vimium-c/keyboard-test.html, turn off Vimium on it and reload page, and then press play/pause media keys to see what it will record.

@Dave562CZ
Copy link
Author

Hello sorry it took so long, it recorded this when I pressed it twice:

  Event Code Key Modifiers KeyCode (legacy)
1 keydown KeyG MediaPlayPause   179
2 keyup KeyG MediaPlayPause   179
3 keydown KeyG MediaPlayPause   179
4 keyup KeyG MediaPlayPause   179

@gdh1995
Copy link
Contributor

gdh1995 commented Oct 16, 2020

It's because of the Code: KeyG: on every pause key, Vimium gets a g, and on the second the key sequence becomes gg, so it triggers scrollToTop.

You need to uncheck the option of "This forces the use of en-US QWERTY layout and can be helpful for non-Latin keyboards.", to let Vimium not use keyboardevent.code

@Dave562CZ
Copy link
Author

I see, thanks it worked.

gdh1995 added a commit to gdh1995/vimium-c that referenced this issue Oct 17, 2020
@gdh1995
Copy link
Contributor

gdh1995 commented Oct 17, 2020

I got an idea to fix this mismatch when keeping "QWERTY layout" enabled, so could you do me a favor and test such zip files?

I have a customized version of Vimium, named Vimium C, and I've compiled its gdh1995/vimium-c@cc46d81 and got 2 zip files: vimium_c-1.86.2-firefox-cc46d81.zip, vimium_c-1.86.2-chrome-cc46d81.zip. You may installed such a zip on chrome://extensions and then test your pause/resume keys on its option page, and here's a tutorial: https://github.com/gdh1995/vimium-c/wiki/Test-a-zip-package .

@Dave562CZ
Copy link
Author

Ok it works correctly for me with the Vimium C both in chrome and firefox

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants