mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 10:31:47 +00:00
19 lines
425 B
JavaScript
19 lines
425 B
JavaScript
// This is used for to control the songs
|
|
const pressKey = (window, key) => {
|
|
window.webContents.sendInputEvent({
|
|
type: "keydown",
|
|
keyCode: key,
|
|
});
|
|
};
|
|
|
|
module.exports = (win) => {
|
|
return {
|
|
previous: () => pressKey(win, "k"),
|
|
next: () => pressKey(win, "j"),
|
|
playPause: () => pressKey(win, "space"),
|
|
like: () => pressKey(win, "_"),
|
|
dislike: () => pressKey(win, "+"),
|
|
search: () => pressKey(win, "/"),
|
|
};
|
|
};
|