musicplayer-io / redditmusicplayer

:musical_note: A free and open-source streaming music web player using data from Reddit
https://reddit.musicplayer.io/
GNU General Public License v3.0
418 stars 50 forks source link

Windows 10 virtual desktop shortcut #58

Open Illyism opened 8 years ago

Illyism commented 8 years ago

I use multiple virtual desktops on Windows 10. Usually I'm working on desktop 1, and have the musicplayer on desktop 2 in chrome, doing it's thing. When I use the keyboard shortcut "ctrl + windows + right arrow" to jump to desktop two, the song I have playing stops and the player skips to the next song. I think the music player has to be in focus, and the song I'm playing has to be the last thing I clicked in the music player.

mihe commented 7 years ago

For anyone else annoyed by this, here's a small userscript that disables the arrow keys. I've only tested it with the Tampermonkey extension on Chrome.

// ==UserScript==
// @name reddit.musicplayer.io
// @description Disables arrow keys at reddit.musicplayer.io
// @match *://reddit.musicplayer.io/*
// @version 1.0
// ==/UserScript==
(function() {
    unsafeWindow.document.addEventListener('keyup', function(e) {
        switch (e.keyCode) {
            case 37: // Left
            case 38: // Up
            case 39: // Right
            case 40: // Down
                e.stopImmediatePropagation();
                return;
        }
    }, true);
})();