Hello guys, im new here - have a question about a keyboard shortcut.
-
Hi everyone, i recently joined the forum and i started using Vivaldi recently. I so far love the amount of customization that you can do, and its my main browser now, its incredible! But i have a question about keyboard shortcuts.
I normally dont use the CTRL + TAB shortcut to move between tabs, i dont find it comfortable, so ive mapped "Previous Tab (by order)" to ALT + left arrow key and "Next Tab (by order)" to ALT + right arrow key. I really like it that way!, but there is a problem with it, sometimes i have a tab opened with a Youtube video, the thing is that if i switch tabs with the way i have it configured now, the video either goes forward o backwards 5 seconds everytime i switch tabs to the left or right of the tab i have the video in, because im pressing the arrow keys.
So my question is: Is there a way to disable the Keyboard Shorcuts that Youtube has so that i can avoid the seek forward/backward 5 seconds everytime i press the arrow keys to switch tabs?
I havent found a way to do it, so i was thinking about mapping the same actions to the WASD keys, Alt + A for moving to the previous tab and Alt + D for moving to the next tab, but i would prefer to use the Alt + arrow keys because i find it way more comfortable, if not for the problem on Youtube videos.
Thanks in advance!
-
@Rich001 No easy way, you would probably have to write an extension. Just switch the focus to the UI by assigning the focus next pane/previous pane shortcuts in Vivaldi, then your shortcut will work. Or yes, change your shortcut to something Youtube doesn’t use. Would
ctrl–arrow
work? -
@Rich001 said in Hello guys, im new here - have a question about a keyboard shortcut.:
so ive mapped "Previous Tab (by order)" to ALT + left arrow key and "Next Tab (by order)" to ALT + right arrow key. I really like it that way!
Hey! I had the same idea some time ago!
But I couldn't use it too.
I think it looks like a bug. Site should't use the internal Vivaldi shortcuts. -
@Stardust Unfortunately all sites overrule Vivaldi shortcuts, especially when you use single key shortcuts. The only curious thing about this case is that it overrules a shortcut with modifier, that doesn’t happen usually.
-
@luetage said in Hello guys, im new here - have a question about a keyboard shortcut.:
The only curious thing about this case is that it overrules a shortcut with modifier, that doesn’t happen usually.
Exactly! That's why I am thinking about bugreport
-
@Stardust Not sure, the site does the intercepting, it’s their code. All sites can intercept any shortcut, even with modifier. They just don’t do it usually. So a bugreport should go out to Youtube instead. Good luck with that…
-
@Rich001 I found a userscript for the issue, which works out just fine: https://superuser.com/questions/168087/how-to-forbid-keyboard-shortcut-stealing-by-websites-in-firefox
Personally I adapted it to whitelist some keys and intercept all other keys on all sites, because website shortcuts are annoying and I navigate with Vimium anyway.
// ==UserScript== // @name Intercept Shortcuts // @description Stops websites from hijacking keyboard shortcuts. // @version 0.6 // @match *://*/* // @run-at document-start { 'use strict'; const keycodes = [9, 13, 16, 20, 27, 32, 37, 38, 39, 40]; //whitelists tab, enter, shift, capslock, escape, space and all arrow keys document.addEventListener('keydown', e => { // console.log(e.keyCode); if (keycodes.indexOf(e.keyCode) === -1) { e.cancelBubble = true; e.stopImmediatePropagation(); } return false; }) }
You gotta adapt this to your personal needs, for example you could run it on youtube exclusively and only intercept the
alt-arrow
combinations. Tell me whether you need help with that. Userscripts can be installed by creating a file (e.g.intercept.user.js
) and dragging it tovivaldi://extensions/
. Make sure to enable developer mode first. -
@luetage said in Hello guys, im new here - have a question about a keyboard shortcut.:
All sites can intercept any shortcut, even with modifier.
Well, that's annoying. Why there is no setting to prevent this?
ALT +and ALT +
are default shortcuts and even they work strange on YouTube in Vivaldi and Firefox.
Old ghacks article:
https://www.ghacks.net/2014/08/15/how-to-prevent-websites-from-hijacking-keyboard-shortcuts/ -
@Stardust Yes, websites should never be allowed to intercept browser shortcuts. Why this is a thing I don’t understand at all. You can make a feature request for it.
edit: That’s a good article, it even links the same solution.
-
@luetage said in Hello guys, im new here - have a question about a keyboard shortcut.:
@Stardust Yes, websites should never be allowed to intercept browser shortcuts.
Yep!
Why this is a thing I don’t understand at all.
those
sites hijacking our shortcuts!
You can make a feature request for it.
Will do
BTW I
googledanother thread:
https://forum.vivaldi.net/topic/38701/i-want-to-prevent-websites-highjacking-stealing-vivaldi-keyboard-commands-so-i-can-rely-on-shortcuts?page=1 -
-
@luetage said in Hello guys, im new here - have a question about a keyboard shortcut.:
@Rich001 No easy way, you would probably have to write an extension. Just switch the focus to the UI by assigning the focus next pane/previous pane shortcuts in Vivaldi, then your shortcut will work. Or yes, change your shortcut to something Youtube doesn’t use. Would
ctrl–arrow
work?Hello, ive been reading all of your replies and the ones from @Stardust, and reading and learning about this shortcut stealing by websites, i didnt know this was a well-know problem and that it had its own kind of name, thank you so much for the knowledge to both of you.
Regarding this reply, ive tried the focus next/previous pane shortcut, it works in the way that i can highlight the address bar, and then the ALT + arrow keys work as intended on youtube, but honestly i dont like to have to be doing that to make it work properly, and the Ctrl + arrow keys is the same as Alt + arrow keys, youtube seems to override everything.
-
@Stardust said in Hello guys, im new here - have a question about a keyboard shortcut.:
@Rich001 said in Hello guys, im new here - have a question about a keyboard shortcut.:
so ive mapped "Previous Tab (by order)" to ALT + left arrow key and "Next Tab (by order)" to ALT + right arrow key. I really like it that way!
Hey! I had the same idea some time ago!
But I couldn't use it too.
I think it looks like a bug. Site should't use the internal Vivaldi shortcuts.Haha yes! i had the idea of mapping the shortcut to switch tabs that way because for me is very comfortable to press alt with my left thumb and keeping the fingers of my right hand on the arrow keys, and moving in the websites with the arrow keys as well, it works pretty well on most sites but on youtube gives that problem.
-
@Rich001 You can try the userscript method, it solves your issue.
-
@luetage said in Hello guys, im new here - have a question about a keyboard shortcut.:
@Stardust Unfortunately all sites overrule Vivaldi shortcuts, especially when you use single key shortcuts. The only curious thing about this case is that it overrules a shortcut with modifier, that doesn’t happen usually.
Thats right, ive been triying the same on other video websites like twitch for example, and they dont present that problem, the arrow key shorcuts with any modifier work perfectly fine, its just youtube that overrides all types of shorcuts even with modifier, all arrow keys + Alt, ctrl and shift combinations present the same problem.
-
@luetage said in Hello guys, im new here - have a question about a keyboard shortcut.:
@Rich001 I found a userscript for the issue, which works out just fine: https://superuser.com/questions/168087/how-to-forbid-keyboard-shortcut-stealing-by-websites-in-firefox
Personally I adapted it to whitelist some keys and intercept all other keys on all sites, because website shortcuts are annoying and I navigate with Vimium anyway.
// ==UserScript== // @name Intercept Shortcuts // @version 0.5 // @description Stops websites from hijacking keyboard shortcuts. // @match https://*/* // @run-at document-start const keycodes = [9, 13, 16, 20, 27, 32, 37, 38, 39, 40]; //whitelists tab, enter, shift, capslock, escape, space and all arrow keys document.addEventListener('keydown', function(e) { // console.log(e.keyCode ); if (keycodes.indexOf(e.keyCode) === -1) { e.cancelBubble = true; e.stopImmediatePropagation(); } return false; });
You gotta adapt this to your personal needs, for example you could run it on youtube exclusively and only intercept the
alt-arrow
combinations. Tell me whether you need help with that. Userscripts can be installed by creating a file (e.g.intercept.user.js
) and dragging it tovivaldi://extensions/
. Make sure to enable developer mode first.Yes, ive been reading a little about this on the articles you shared, but honestly i know little to nothing about those coding things, so i would need your help with this posible solution.
If you can and have the time, i would like if you could make it so that it intercepts All Ctrl, Shift and Alt + arrow keys combinations on all websites maybe, or just on Youtube as you said, if it is easier, or at least the way that you said about Alt + arrows on youtube only, whatever you could help me, i would appreciate it very much.
-
@Rich001 Try this:
// ==UserScript== // @name Intercept Shortcuts // @version 0.5 // @description Stops websites from hijacking keyboard shortcuts. // @match https://*/* // @run-at document-start const keycodes = [37, 38, 39, 40]; //arrow keys document.addEventListener('keydown', function(e) { // console.log(e.keyCode ); if ((e.ctrlKey || e.metaKey || e.shiftKey || e.altKey) && keycodes.indexOf(e.keyCode) !== -1) { e.cancelBubble = true; e.stopImmediatePropagation(); } return false; })
-
@luetage Hey It works! It totally solves the issue, ive been testing it and it does the trick! Thank you so much for your help!!
-
@Gwen-Dragon Thank you very much
-
-
Ppafflick moved this topic from Mail, Calendar & Feeds on
-
Ppafflick moved this topic from Chit-Chat on
-
Ppafflick moved this topic from Everything else on