From b92f7fae79000da520365703875c1be1ce8f7230 Mon Sep 17 00:00:00 2001 From: elioat Date: Fri, 12 Jan 2024 21:31:19 -0500 Subject: * --- js/inknswitch/index.html | 2 +- js/inknswitch/ink.js | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'js') diff --git a/js/inknswitch/index.html b/js/inknswitch/index.html index 8a9dbc5..91f9ff2 100644 --- a/js/inknswitch/index.html +++ b/js/inknswitch/index.html @@ -30,7 +30,7 @@ - + diff --git a/js/inknswitch/ink.js b/js/inknswitch/ink.js index e51bbcd..bd5fb6d 100644 --- a/js/inknswitch/ink.js +++ b/js/inknswitch/ink.js @@ -113,5 +113,14 @@ document.addEventListener('keydown', (e) => { } } + // S key to save the canvas as an image + if (e.key === 's' && canvas.style.pointerEvents === 'auto') { + const dataUrl = canvas.toDataURL(); + const a = document.createElement('a'); + a.href = dataUrl; + a.download = 'canvas.png'; + a.click(); + } + localStorage.setItem('noteContent', noteArea.value); }); \ No newline at end of file -- cgit 1.4.1-2-gfad0