My question is very similar to this one, only I would like to be able to control YouTube's fast forward and backwards feature (the one you do with right and left arrow when focused) while unfocused.

I have a keyboard with media key functionality (a Logitech G915), the reason I need to skip forward and backwards when unfocused is because I generally have the video open in one tab on one side of the screen, while I take notes on my note app on the right side. The pause key already works while unfocused, but I often need to skip back a few seconds in the video to catch something I missed while writing. I cannot do that right now without switching focus onto the YouTube window, skipping back, and then focusing back onto the note-taking app.

All the extensions I could find, such as streamkeys allow to use the two other media keys to move to the next or previous video in the playlist, but not to use them to skip forwards and backwards.

Is there a way I could do that?

  • I don't think this question is a duplicate. The proposed duplicate question seems to be asking about YouTube keyboard shortcuts when the browser window/webpage is focused but the video element itself is not focused. OP is asking a different question (and one that I would also like answered): How can we skip back/forward in YouTube when the browser window is completely unfocused/minimized/etc and we're working in a completely different application?
    – Michael
    Commented Feb 1, 2022 at 18:23

1 Answer 1



I made a AutoHotKey script to perform this. Upon the pressing of the next or previous track media keys on the keyboard, the script auto-presses alt+tab followed by the arrow key (the left arrow for the 'previous track' media button or the right arrow for the 'next track' media button), then alt tab again.

The script also does the same for the play/pause button as mine wasn't working without YouTube being the active window however you can open the script and remove this part if yours already works.

I just learnt AutoHotKey to write this script so there's most definitely a better way to do this as this script has some caveats: It will only work if your YouTube or whatever media site window was the previously open window. It will also not work if YouTube or your media site is already active as it will switch away from the site. If you are taking notes or doing whatever other task in a different tab of the same browser window it also will not work, you must be using another window (just drag this tab into a new window).

Some things that would improve this script if any more experienced AutoHotKey users are reading:

  • Detection of an active YouTube window/tab to navigate to specifically instead of just using alt+tab, before switching back to the initially active window/tab -Disabling the switching action if YouTube is already active
  • Integration with YouTube API if that is possible in order to avoid switching active windows at all?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.