From e68a40cd3cced0fbd4802af75576b392cf8b427f Mon Sep 17 00:00:00 2001 From: FierySama Date: Mon, 3 Feb 2020 16:40:33 -0800 Subject: [PATCH 1/4] Alt + T shortcut to toggle theatermode Alt t keycombo now toggles theatermode on and off! Escape still works too. --- src/injected-content/mixrelixr.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/injected-content/mixrelixr.js b/src/injected-content/mixrelixr.js index cf39f81d..f54bbb1e 100644 --- a/src/injected-content/mixrelixr.js +++ b/src/injected-content/mixrelixr.js @@ -932,7 +932,7 @@ $(() => { theaterBtn.find('i').text('event_seat'); // change tooltip text - theaterBtn.find('span').text('MixrElixr: Theater Mode'); + theaterBtn.find('span').text('MixrElixr: Theater Mode (Alt + T)'); // add click handler theaterBtn.on('click', function() { @@ -1048,7 +1048,7 @@ $(() => { heading: 'Theater Mode Enabled', showHideTransition: 'fade', allowToastClose: true, - hideAfter: 3000, + hideAfter: 3250, stack: false, position: 'top-center', bgColor: '#151C29', @@ -2222,6 +2222,13 @@ $(() => { } }); + // Alt + T theater toggle keycombo listener + $(document).keydown(function(t) { + if (t.code === 'KeyT' && t.altKey) { + toggleTheaterMode(); + } + }); + function mapEmoteSizeToClass(size) { switch (size) { case 24: From 6f6a70a68ab2b3f77f0f88220d35a422403cf633 Mon Sep 17 00:00:00 2001 From: FierySama Date: Tue, 4 Feb 2020 15:26:28 -0800 Subject: [PATCH 2/4] keybind to Shift + T to avoid Firefox conflicts This fixes alt bringing up Firefox's alt menu. Works on both chrome and ff. --- src/injected-content/mixrelixr.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/injected-content/mixrelixr.js b/src/injected-content/mixrelixr.js index f54bbb1e..ea14faed 100644 --- a/src/injected-content/mixrelixr.js +++ b/src/injected-content/mixrelixr.js @@ -932,7 +932,7 @@ $(() => { theaterBtn.find('i').text('event_seat'); // change tooltip text - theaterBtn.find('span').text('MixrElixr: Theater Mode (Alt + T)'); + theaterBtn.find('span').text('MixrElixr: Theater Mode (Shift + T)'); // add click handler theaterBtn.on('click', function() { @@ -2222,9 +2222,9 @@ $(() => { } }); - // Alt + T theater toggle keycombo listener + // Shift + T theater toggle keycombo listener $(document).keydown(function(t) { - if (t.code === 'KeyT' && t.altKey) { + if (t.code === 'KeyT' && t.shiftKey) { toggleTheaterMode(); } }); From 511b73560632b6d69b14636174d6ccb633e6caea Mon Sep 17 00:00:00 2001 From: FierySama Date: Wed, 5 Feb 2020 16:26:00 -0800 Subject: [PATCH 3/4] Updated to Ctrl + Alt + T or Alt + Ctrl + T * Works on FF, Works on Chrome! * Thank you Reject and Biggz :D * I don't know how to test for macOS so far. --- src/injected-content/mixrelixr.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/injected-content/mixrelixr.js b/src/injected-content/mixrelixr.js index ea14faed..4bbcccfa 100644 --- a/src/injected-content/mixrelixr.js +++ b/src/injected-content/mixrelixr.js @@ -932,7 +932,7 @@ $(() => { theaterBtn.find('i').text('event_seat'); // change tooltip text - theaterBtn.find('span').text('MixrElixr: Theater Mode (Shift + T)'); + theaterBtn.find('span').text('MixrElixr: Theater Mode [Ctrl + Alt + T]'); // add click handler theaterBtn.on('click', function() { @@ -2222,9 +2222,9 @@ $(() => { } }); - // Shift + T theater toggle keycombo listener - $(document).keydown(function(t) { - if (t.code === 'KeyT' && t.shiftKey) { + // Ctrl + Alt + T theater toggle listener + $(document).keydown(function(evt) { + if (evt.ctrlKey && evt.altKey && evt.code === 'KeyT') { toggleTheaterMode(); } }); From df282ac3f233e4750264279d50fed4d77b4f0a10 Mon Sep 17 00:00:00 2001 From: FierySama Date: Thu, 6 Feb 2020 11:19:58 -0800 Subject: [PATCH 4/4] toggle spam fix! Keyup works fantastic here, works on Chrome and FF --- src/injected-content/mixrelixr.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/injected-content/mixrelixr.js b/src/injected-content/mixrelixr.js index 4bbcccfa..f6603e7a 100644 --- a/src/injected-content/mixrelixr.js +++ b/src/injected-content/mixrelixr.js @@ -2223,7 +2223,7 @@ $(() => { }); // Ctrl + Alt + T theater toggle listener - $(document).keydown(function(evt) { + $(document).keyup(evt => { if (evt.ctrlKey && evt.altKey && evt.code === 'KeyT') { toggleTheaterMode(); }