Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

246
Visualizações
In an Electron app, can you combine `Command` with `MediaNextTrack` as a global shortcut?

I'm trying to add a Cmd+MediaNextTrack shortcut to this app I'm building.

Combined shortcuts (like e.g. Cmd+Shift+Space) seem to work fine in my Electron app.

I am aware of the Security & Privacy / Accessibility setting that needs to be enabled for MediaNextTrack to be accessible. It's enabled locally; the following code works:

    let successfullyRegistered = globalShortcut.register('MediaNextTrack', async () => {
        console.log("==> activated.")
    });

and it actually takes over any "next track" action from Spotify and correctly logs to console.

Also the successfullyRegistered boolean returns as true.

However if I change that code to:

    let successfullyRegistered = globalShortcut.register('Cmd+MediaNextTrack', async () => {
        console.log("==> activated.")
    });

The console is no longer activated.

But successfullyRegistered is true.

And globalShortcut.isRegistered("Cmd+MediaNextTrack") returns true as well.

Various variations of Cmd don't work either: Command+MediaNextTrack, CommandOrControl+MediaNextTrack don't work either.


Question

Is there another way to activate that command + next track shortcut in the app?

about 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda