9

One feature that annoys me to no end on recent browsers is the insistance on hijacking the system media keys. Now at least you can disable it in Chrome (chrome://flags/#hardware-media-key-handling) and Firefox (media.hardwaremediakeys.enabled), I do not see a similar option for Orion. This makes Orion almost unusable for me. Please add an option to diable it.

  • Vlad replied to this.

    theLMGN What are system media keys and who is hijacking them?

      The system media keys are the keys on your keyboard (or touch bar) that control the system media, i.e. pause, play, previous, next.

      There is a trend among web browsers to take over these keys for whatever reason, redirecting their actions away from Music.app, Spotify, etc, to the web browser, so when you press the play key on your keyboard, instead of pausing/playing music in your music player, it for example, plays a YouTube video after it's been closed, or plays the notification sound of a website I have loaded in the background.

      • Vlad replied to this.

        theLMGN Please be concrete. I am sure browsers are not doing this, but perhaps web apps (which can have shortcuts). So can you describe a full use case end to end?

          +1 to this, I absolutely hate when I'm listening to Apple Music with a YouTube video paused somewhere in my browser, then, when I use the keyboard play/pause button it starts playing the YouTube video in the background without pausing my music.
          I personally never have a reason for the keyboard play/pause button to alter anything playing in my browser, as I'm normally watching it on an active tab, in which case the space bar is my goto for playing/pausing whatever it is I'm watching.

            Vlad Browsers do this automatically whenever there is any audio/video on this page. Even if it was controlled by the page itself, i'd still want a way to turn it off

              Waiting for concrete steps to reproduce.

                9 months later

                @Vlad

                1. Open media
                2. Press the play pause button on your keyboard.

                This has been my #1 blocker why I can't use Orion or Safari on the daily.

                • Vlad replied to this.

                  Another way to reproduce this is to be listening to music, say on Spotify or Apple Music, and you have an app like Discord in your browser. You hit the pause button on your keyboard, so you can hear the person at the other end of the phone. The ringtone pauses. Not the music. The ringtone.

                    theLMGN If both Safari and Orion behave the same, you may want to report this as a feature request to webkit.org

                      7 months later

                      +1
                      just got a macbook with touchbar and I found Orion, been enjoying it a lot apart from the fact that when I am listening to music on Spotify and with Orion open the touchbar controls any media from the browser instead of spotify.
                      Would be amazing to have an option to disable hardware media keys like you can on Flags in Chrome and Firefox.
                      EDIT: I found something! Someone made an app that redirects the button prompts to the correct app, you can choose between iTunes and Spotify. Works pretty well!
                      https://github.com/quentinlesceller/macmediakeyforwarder/releases

                        5 months later

                        I also support this request and I think it should be in the browser for security reasons. As a general rule I don't think websites should be able to alter the functionality of applications on the system without explicit control from the browser. In this case websites are able to intercept the hardware media playback keys that are otherwise going to iTunes or other system applications.

                        What I would like to see is a UI preference for controlling Hardware Media Keys controls: Disabled, Enabled, and Enabled for Select Websites (e.g. one could specify just Spotify can take over the hardware media keys thus excluding other websites such as Youtube and WSJ from intercepting those keys).

                        I would also like to see a similar thing for system/browser keyboard shortcuts but will request that separately. As a preview of this issue, some websites like TikTok are able to redirect browser keyboard shortcuts like Command-L and Command-N which I think could have security implications. It is routine for advanced applications (e.g. Google Sheets) to grab some keyboard shortcuts but I think shortcuts that are used by the browser (system, etc) should be off limits (and that limit should be enforced by the browser).

                        In any case while Safari and Orion+ seem to handle this the same currently I don't think this is actually handled by WebKit. My guess is that Apple's system library routines are just passing through all events unless intercepted so Safari and Orion+ end up with the same behavior. If it helps, below is how Chromium intercepts media key events to process and otherwise lets other events pass through:

                        // Convert the CGEvent to an NSEvent for access to the data1 field.
                        NSEvent* ns_event = [NSEvent eventWithCGEvent:event];
                        if (ns_event == nil) {
                        return event;
                        }
                        // Ignore events that are not system defined media keys.
                        if (type != NX_SYSDEFINED
                        [ns_event type] != NSSystemDefined

                        [ns_event subtype] != kSystemDefinedEventMediaKeysSubtype) {
                        return event;
                        }
                        NSInteger data1 = [ns_event data1];
                        // Ignore media keys that aren't previous, next and play/pause.
                        // Magical constants are from http://weblog.rogueamoeba.com/2007/09/29/
                        int key_code = (data1 & 0xFFFF0000) >> 16;
                        if (key_code != NX_KEYTYPE_PLAY && key_code != NX_KEYTYPE_NEXT &&
                        key_code != NX_KEYTYPE_PREVIOUS && key_code != NX_KEYTYPE_FAST &&
                        key_code != NX_KEYTYPE_REWIND) {
                        return event;
                        }

                        • Vlad replied to this.

                          bzgnyc Due to nature of this (WebKit related) it would be better to post this as a report on webkit.org

                            Thanks Vlad, can you clarify for me (and thus to request it to WebKit) why controlling this behavior belongs there rather than the browser? Is there a reason why you believe cleaner to handle there rather than Orion?

                            • Vlad replied to this.

                              bzgnyc Because we did not specifically code this behavior, and since Safari exhibits it as well the common denominator is WebKit

                                No one is typing