diff --git a/desktop/sources/index.html b/desktop/sources/index.html index 1d47400..0a0b3b8 100644 --- a/desktop/sources/index.html +++ b/desktop/sources/index.html @@ -50,6 +50,15 @@ controller.add("default","Theme","Download Themes..",() => { require('electron').shell.openExternal('https://github.com/hundredrabbits/Themes') }) controller.commit() + + document.body.addEventListener('keydown', e => { + switch(e.keyCode) { + case 27: // Esc + e.preventDefault() + pilot.recorder.stop() + break + } + }) pilot.install(document.body) pilot.start() diff --git a/desktop/sources/scripts/recorder.js b/desktop/sources/scripts/recorder.js index 0e03794..1d9495b 100644 --- a/desktop/sources/scripts/recorder.js +++ b/desktop/sources/scripts/recorder.js @@ -41,6 +41,8 @@ function Recorder (pilot) { } this.stop = function () { + if(!this.isRecording) { return } + console.log('Recorder', 'Stopping..') this.isRecording = false pilot.mixer.recorder.stop()