diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 8e369ad..0b719e3 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,5 @@ +v1.0.222: Added Keyboard shortcuts for GotoZero, and switching between Incremental/Continuous jogging +v1.0.221: Corrected product names for XYZ Probe Plus v1.0.220: New XYZ and Custom Probe wizards, new Probe Button on Main toolbar, fixed File Assocation Opening (Bug #119 ), added loaded Filename to titlebar (Issue #116), changed Keybinding for Devtools to ctrl+shift+i, added shortcut key F6 to jump to console (Issue #112) v1.0.216-219: Internal Testing versions only v1.0.215: Fixed bug with Z Plate retract where plate is thicker than 10mm diff --git a/app/js/keyboard.js b/app/js/keyboard.js index bc58a36..16b5169 100644 --- a/app/js/keyboard.js +++ b/app/js/keyboard.js @@ -35,9 +35,20 @@ $(document).ready(function() { if (localStorage.getItem('keyboardShortcuts')) { keyboardShortcuts = JSON.parse(localStorage.getItem('keyboardShortcuts')); + // fix incorrect key naming bug from an old version if (keyboardShortcuts.xP == "arrowright") { keyboardShortcuts.xP == "right" } + // add new key defaults to existing allocations + if (!keyboardShortcuts.incJogMode) { + keyboardShortcuts.incJogMode = "/" + } + if (!keyboardShortcuts.conJogMode) { + keyboardShortcuts.conJogMode = "*" + } + if (!keyboardShortcuts.gotozeroxyz) { + keyboardShortcuts.gotozeroxyz = "del" + } } else { keyboardShortcuts = { xP: "right", //X+ @@ -52,7 +63,10 @@ $(document).ready(function() { playpause: "space", // Start, Pause, Resume unlockAlarm: "end", // Clear Alarm home: "home", // Home All - setzeroxyz: "insert" // Set ZERO XYZ + setzeroxyz: "insert", // Set ZERO XYZ + gotozeroxyz: "del", // go to zero xyz + incJogMode: "/", // Incremental Jog Mode + conJogMode: "*" // Continuous Jog Mode } } bindKeys() @@ -281,11 +295,17 @@ function bindKeys() { } if (keyboardShortcuts.stepM.length) { $(document).bind('keydown', keyboardShortcuts.stepM, function(e) { + $('#jogTypeContinuous').prop('checked', false) + allowContinuousJog = false; + $('.distbtn').show(); changeStepSize(-1) }); } if (keyboardShortcuts.stepP.length) { $(document).bind('keydown', keyboardShortcuts.stepP, function(e) { + $('#jogTypeContinuous').prop('checked', false) + allowContinuousJog = false; + $('.distbtn').show(); changeStepSize(1) }); } @@ -326,6 +346,31 @@ function bindKeys() { }); } + if (keyboardShortcuts.gotozeroxyz.length) { + $(document).bind('keydown', keyboardShortcuts.gotozeroxyz, function(e) { + sendGcode('G21 G90'); + sendGcode('G0 Z5'); + sendGcode('G0 X0 Y0'); + sendGcode('G0 Z0'); + }); + } + + if (keyboardShortcuts.incJogMode.length) { + $(document).bind('keydown', keyboardShortcuts.incJogMode, function(e) { + $('#jogTypeContinuous').prop('checked', false) + allowContinuousJog = false; + $('.distbtn').show(); + }); + } + + if (keyboardShortcuts.conJogMode.length) { + $(document).bind('keydown', keyboardShortcuts.conJogMode, function(e) { + $('#jogTypeContinuous').prop('checked', true) + allowContinuousJog = true; + $('.distbtn').hide() + }); + } + localStorage.setItem('keyboardShortcuts', JSON.stringify(keyboardShortcuts)); } @@ -357,6 +402,12 @@ function keyboardShortcutsEditor() { +