|
|
@ -15,6 +15,9 @@ |
|
|
|
* m - mouse move |
|
|
|
* m - mouse move |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
window.Input = function (conn, screen) { |
|
|
|
window.Input = function (conn, screen) { |
|
|
|
|
|
|
|
// handle for input object
|
|
|
|
|
|
|
|
let input |
|
|
|
|
|
|
|
|
|
|
|
const KEY_NAMES = { |
|
|
|
const KEY_NAMES = { |
|
|
|
0x03: 'Cancel', |
|
|
|
0x03: 'Cancel', |
|
|
|
0x06: 'Help', |
|
|
|
0x06: 'Help', |
|
|
@ -299,10 +302,16 @@ window.Input = function (conn, screen) { |
|
|
|
}) |
|
|
|
}) |
|
|
|
window.addEventListener('paste', e => { |
|
|
|
window.addEventListener('paste', e => { |
|
|
|
e.preventDefault() |
|
|
|
e.preventDefault() |
|
|
|
console.log('User pasted:\n' + e.clipboardData.getData('text/plain')) |
|
|
|
let string = e.clipboardData.getData('text/plain') |
|
|
|
|
|
|
|
if (string.includes('\n') || string.length > 90) { |
|
|
|
// just write it for now
|
|
|
|
if (!input.termUpload) console.error('input.termUpload is undefined') |
|
|
|
sendString(e.clipboardData.getData('text/plain')) |
|
|
|
input.termUpload.setContent(string) |
|
|
|
|
|
|
|
input.termUpload.open() |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
// simple string, just paste it
|
|
|
|
|
|
|
|
if (screen.bracketedPaste) string = `\x1b[200~${string}\x1b[201~` |
|
|
|
|
|
|
|
sendString(string) |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
cfg.all_fn = allFn |
|
|
|
cfg.all_fn = allFn |
|
|
@ -361,7 +370,7 @@ window.Input = function (conn, screen) { |
|
|
|
return modifiers |
|
|
|
return modifiers |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
input = { |
|
|
|
/** Init the Input module */ |
|
|
|
/** Init the Input module */ |
|
|
|
init, |
|
|
|
init, |
|
|
|
|
|
|
|
|
|
|
@ -428,4 +437,5 @@ window.Input = function (conn, screen) { |
|
|
|
cfg.no_keys = yes |
|
|
|
cfg.no_keys = yes |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return input |
|
|
|
} |
|
|
|
} |
|
|
|