From a00902dc459fb2a483caccb3587a464a1a652db6 Mon Sep 17 00:00:00 2001 From: Dave Justice Date: Tue, 2 May 2017 23:03:57 -0400 Subject: [PATCH] change volume with keystrokes (#796) - fixes #397 --- components/sound-control.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/components/sound-control.js b/components/sound-control.js index 6d6ee5c..6cda1a1 100644 --- a/components/sound-control.js +++ b/components/sound-control.js @@ -19,6 +19,24 @@ module.exports = class SoundControl extends React.Component { if (window.AppData.muted) this.unmute(); else this.mute(); }); + + keyboardJS.bind('up', ev => { + if (window.AppData.muted) this.unmute(); + this.setVolume({ + target: { + value: window.AppData.volume + .05 + } + }); + }); + + keyboardJS.bind('down', ev => { + if (window.AppData.muted) return; + else this.setVolume({ + target: { + value: window.AppData.volume - .05 + } + }); + }); } enterSound() {