Skip to content

Instantly share code, notes, and snippets.

Last active December 3, 2021 16:40
What would you like to do?
Streamyard Keyboard Shortcuts
// ==UserScript==
// @name Streamyard Keyboard Shortcuts
// @namespace
// @version 0.1
// @description Simple keyboard shortcuts for streamyard
// @author
// @match*
// @grant none
// @run-at document-end
// ==/UserScript==
(function() {
'use strict';
document.addEventListener('keydown', function(e) {
if (e.key == "m" && !e.shiftKey && !e.ctrlKey && !e.altKey && !e.metaKey) {
var unmuteButton = document.querySelector('[aria-label="Unmute microphone"]');
var muteButton = document.querySelector('[aria-label="Mute microphone"]');
if (unmuteButton !== null) {;
} else {;
} else if (e.key == "v" && !e.shiftKey && !e.ctrlKey && !e.altKey && !e.metaKey) {
var faceUnmuteButton = document.querySelector('[aria-label="turn on camera"]');
var faceMuteButton = document.querySelector('[aria-label="turn off camera"]');
if (faceUnmuteButton !== null) {;
} else {;
}, false);
Copy link

cesarhernandezgt commented Sep 23, 2020

Hi @rothgar is this a script you can add to a live Streamyard session?
If yes, I tried to add it editing vie google chrome developer tools and adding in the <head> section something like:

<script type="text/javascript" async="" src=""></script>

But after typing m the mute action didn't trigger. any clue on what's went wrong?

Copy link

rothgar commented Sep 23, 2020

I'm loading the script with tampermonkey

It works but has some bugs I haven't had time to fix yet. Would welcome any feedback/updates to make it more stable.

Specifically I need to detect when the keyboard isn't focused on an input field (chat window)

Copy link

I'm interested in this, can I make it work with my Elgato Stream Deck?

Copy link

I'm interested in this, can I make it work with my Elgato Stream Deck?

I was able to use a Stream Deck with this no problem, simply simulate the keyboard presses in the software and have Streamyard open with this script and it works. I was also able to modify this to simulate a few other shots like the various layouts since they all had unique aria text. Thanks @rothgar!

Copy link

YG0613 commented Dec 3, 2021

Could scripts like these be used with Tampermonkey to execute cusotm multi-action macros in Streamyard?

For example, I would love to be able to program a key on the Elgato Stream Deck to put a png or GIF overlay onto the stream for a specified amount of time and then take it down, for example Like or Subscribe images or animations for 3-5 seconds.

If yes, and someone would be interested in putting some code together (for remuneration) please reach out [yisroel @].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment