Loading static/js/jslinux.api.mjs +14 −0 Original line number Diff line number Diff line Loading @@ -228,3 +228,17 @@ export function setAutoFocusEnabled(enabled) { } } : null } /** * Register a function that is called every time the user wants to execute Ctrl+C or Ctrl+V in the terminal. * Does not prevent this from being executed! * * @param {Function} handler Function to be called without parameters on Ctrl+C and Ctrl+V */ export function onCopyOrPasteHotkey(handler) { document.querySelector("textarea.term_textarea").addEventListener("keydown", event=>{ if(event.ctrlKey && (event.key == "c" || event.key == "v")) { handler() } }) } Loading
static/js/jslinux.api.mjs +14 −0 Original line number Diff line number Diff line Loading @@ -228,3 +228,17 @@ export function setAutoFocusEnabled(enabled) { } } : null } /** * Register a function that is called every time the user wants to execute Ctrl+C or Ctrl+V in the terminal. * Does not prevent this from being executed! * * @param {Function} handler Function to be called without parameters on Ctrl+C and Ctrl+V */ export function onCopyOrPasteHotkey(handler) { document.querySelector("textarea.term_textarea").addEventListener("keydown", event=>{ if(event.ctrlKey && (event.key == "c" || event.key == "v")) { handler() } }) }