I want to add keyboard shortcuts to pake-youtube! #1372
|
Hi, Could you please tell me how to add j, k , d (scroll down half a page) and u (scroll up half a page) Thank you! |
Replies: 2 comments
|
The prebuilt pake-youtube binary has no settings panel for extra keys. You add them by injecting JS and rebuilding. Save something like document.addEventListener('keydown', (e) => {
if (['INPUT', 'TEXTAREA'].includes(e.target.tagName) || e.target.isContentEditable) return;
const h = window.innerHeight;
if (e.key === 'd' && !e.ctrlKey) { window.scrollBy(0, h / 2); e.preventDefault(); }
if (e.key === 'u' && !e.ctrlKey) { window.scrollBy(0, -h / 2); e.preventDefault(); }
if (e.key === 'g' && !e.shiftKey) { window.scrollTo(0, 0); e.preventDefault(); }
if (e.key === 'G') { window.scrollTo(0, document.documentElement.scrollHeight); e.preventDefault(); }
}, true);YouTube already binds Rebuild: pake https://www.youtube.com --name YouTube --inject ./yt-keys.jsDocs: https://github.com/tw93/Pake/blob/main/docs/cli-usage.md ( |
|
Thanks for responding. I want to override j and k even when the player is focused. I'll use arrows or other keys for seeking. |
The prebuilt pake-youtube binary has no settings panel for extra keys. You add them by injecting JS and rebuilding.
Save something like
yt-keys.js:YouTube…