diff --git a/README.md b/README.md index 4a08706..9f9ad65 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,10 @@ npm start +## Buttons + +- Holding right-click while using $helpers will run the script as the mouse is used. + ## Library Additional functions can be found in the [includes](https://github.com/hundredrabbits/Ronin/tree/master/desktop/sources/lisp), you can also look at the [examples](https://github.com/hundredrabbits/Ronin/tree/master/examples) to see them in action. diff --git a/desktop/sources/scripts/commander.js b/desktop/sources/scripts/commander.js index 5c7d08d..1673723 100644 --- a/desktop/sources/scripts/commander.js +++ b/desktop/sources/scripts/commander.js @@ -119,7 +119,7 @@ function Commander (ronin) { this._input.value = this._input.value.replace('$path', `"${path}"`) } - this.commit = function (shape, end = false) { + this.commit = function (shape, end = false, run = false) { if (this.cache.indexOf('$') < 0) { return } const segs = this.cache.split('$') const seg = segs[1] @@ -144,7 +144,9 @@ function Commander (ronin) { if (end === true) { this.cache = this._input.value } - this.run() + if (run === true) { + this.run() + } } // Display diff --git a/desktop/sources/scripts/ronin.js b/desktop/sources/scripts/ronin.js index 4d785da..7b35c56 100644 --- a/desktop/sources/scripts/ronin.js +++ b/desktop/sources/scripts/ronin.js @@ -97,7 +97,7 @@ function Ronin () { this.bindings[id](shape) } if (this.mouseOrigin) { - this.commander.commit(shape, false) + this.commander.commit(shape, false, e.which !== 1) this.surface.clearGuide() this.surface.drawGuide(shape) } @@ -110,7 +110,7 @@ function Ronin () { this.bindings[id](shape) } if (this.mouseOrigin) { - this.commander.commit(shape, true) + this.commander.commit(shape, true, e.which !== 1) } this.mouseOrigin = null this.surface.clearGuide()