jeffvli / feishin

A modern self-hosted music player.
https://feishin.vercel.app
GNU General Public License v3.0
2.46k stars 103 forks source link

Media keys don't work with League of Legends #731

Open Bestfast opened 3 weeks ago

Bestfast commented 3 weeks ago

Expected Behavior

When clicking any media keys, like play-pause and skip, the OS will receive the input and feishin will work accordingly. Works fine with Chrome+YouTube though. Tested both with mpv and web player.

Current Behavior

Currently feishin doesn't process those keys, as if they aren't received. I was unsure this affected feishin at first or it was only related to LoL, but upon further testing with a script I found online, I realized the OS receives the input properly and LoL doesn't block them. You can run this script to test yourself:

from pynput.keyboard import Key, Listener

def on_press(key):
    print('{0} pressed'.format(
        key))

def on_release(key):
    print('{0} release'.format(
        key))
    if key == Key.esc:
        # Stop listener
        return False

# Collect events until released
with Listener(
        on_press=on_press,
        on_release=on_release) as listener:
    listener.join()```

Steps to Reproduce

Add a global media to play-pause, or use the default button on your keyboard Enter in a LoL game (practice tool, tutorial, everything is fine) If you try to use those key, it won't work

Possible Solution

I think it might be related to how feishin listens to hotkey globally, but I'm not sure about that, sorry

Context

No response

Application version

0.8.1

Operating System and version

Win 11

Server and Version

Navidrome

Node Version (if developing locally)

No response