From ff6df2f041c5f184e6b1bf8359afe326e6c04c3b Mon Sep 17 00:00:00 2001 From: Rick Companje Date: Thu, 5 Dec 2013 11:50:02 +0100 Subject: [PATCH] some extra keyboard shortcuts --- js_src/Keyboard.js | 8 ++++++-- js_src/gcodeGenerating.js | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/js_src/Keyboard.js b/js_src/Keyboard.js index 67e936d..cef211c 100644 --- a/js_src/Keyboard.js +++ b/js_src/Keyboard.js @@ -10,6 +10,7 @@ function initKeyboard() { switch (ch) { case 'c': clearDoodle(); break; + case 'n': clearDoodle(); break; case 'p': print(); break; case 'u': oopsUndo(); break; case 'e': settingsWindow.downloadGcode(); break; @@ -18,8 +19,11 @@ function initKeyboard() { case 'C': drawCircle(250,180,80,64); break; //x,y,r,res case 'T': drawCircle(250,180,80,3); break; //triangle case 'X': drawCircle(250,180,80,6); break; //hexagon - case 'H': previewUp(true); break; - case 'h': previewDown(true); break; + case 'h': previewUp(true); break; + case 'H': previewDown(true); break; + case 's': saveSketch(); break; + case 'L': nextDoodle(); break; + case 'l': prevDoodle(); break; case '[': previewTwistLeft(); break; case ']': previewTwistRight(); break; case '\'': resetTwist(); break; diff --git a/js_src/gcodeGenerating.js b/js_src/gcodeGenerating.js index 7afaa21..35eab62 100644 --- a/js_src/gcodeGenerating.js +++ b/js_src/gcodeGenerating.js @@ -145,6 +145,8 @@ function generate_gcode() { for (var layer = 0; layer < layers; layer++) { + gcode.push(";LAYER:"+layer); + var p = JSON.parse(JSON.stringify(points)); // [].concat(points); if (p.length < 2) return;