code-charity / youtube

[top~1 open YouTube & Video browser-extension] - Enrich your experience & choice! 🧰180+ options & clever features 📌set+forget📌Longest-standing(been tough). Please join🧩us👨‍👩‍👧‍👧 ..⋮ {playback|content discovery|player|extra buttons|distractions|related videos|shorts|ads|quality|codec|full tab|full screen}
http://improvedtube.com
Other
3.46k stars 523 forks source link

Remap the "I" key function for mini-player #649

Open erayrafet opened 3 years ago

erayrafet commented 3 years ago

PROBLEM: Currently, the I key is being used to toggle the built-in mini-player feature.

SOLUTION: For consistency with YouTube Music, I'd like to remap the button for activating the mini-player to Q for queue.

ignat980 commented 3 years ago

Remapping YouTube's hotkeys is a royal pain in the a, they use a couple event listeners on keydown/keyup, one on the movie player div and one on the document and call whichever function based on the key press. Not several listeners per action. It's why you can pause a video or seek ±10 seconds without the video element being actively selected. And I don't know of a way to remove those listeners without the console dev tools.

A possible solution might be to create a transparent div above everything that is considered active, that will interpret the keydown instead of the page, but then you'd need to add all the code for every other action (including navigation, commenting, scrolling within the playlist viewer), so it doesn't seem like a very simple solution.

I think the only way this can happen is if enough people complain about customizing hotkeys via the feedback form (unlikely), or if you go work for YouTube and petition a Product Manager to add this kind of feature to their roadmap (also unlikely).