From 6eac6af3193647c0c65f3952e944d3a51b9e180f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Mon, 18 Sep 2017 23:47:48 +0200 Subject: [PATCH] added ctrl+insert for copy to clipboard --- js/term_input.js | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/js/term_input.js b/js/term_input.js index b1ae33a..33637ca 100644 --- a/js/term_input.js +++ b/js/term_input.js @@ -201,25 +201,28 @@ module.exports = function (conn, screen) { 'Control+End': '\x1f[1;5F', // extra shift controls - 'Shift+ArrowLeft': '\x1f[1;2D', - 'Shift+ArrowRight': '\x1f[1;2C', - 'Shift+ArrowUp': '\x1f[1;2A', - 'Shift+ArrowDown': '\x1f[1;2B', - 'Shift+Home': '\x1f[1;2H', - 'Shift+End': '\x1f[1;2F', + 'Shift+ArrowLeft': '\x1f[1;2D', + 'Shift+ArrowRight': '\x1f[1;2C', + 'Shift+ArrowUp': '\x1f[1;2A', + 'Shift+ArrowDown': '\x1f[1;2B', + 'Shift+Home': '\x1f[1;2H', + 'Shift+End': '\x1f[1;2F', // macOS text editing commands - 'Alt+ArrowLeft': '\x1bb', // ⌥← to go back a word (^[b) - 'Alt+ArrowRight': '\x1bf', // ⌥→ to go forward one word (^[f) - 'Meta+ArrowLeft': '\x01', // ⌘← to go to the beginning of a line (^A) - 'Meta+ArrowRight': '\x05', // ⌘→ to go to the end of a line (^E) - 'Alt+Backspace': '\x17', // ⌥⌫ to delete a word (^W) - 'Meta+Backspace': '\x15', // ⌘⌫ to delete to the beginning of a line (^U) + 'Alt+ArrowLeft': '\x1bb', // ⌥← to go back a word (^[b) + 'Alt+ArrowRight': '\x1bf', // ⌥→ to go forward one word (^[f) + 'Meta+ArrowLeft': '\x01', // ⌘← to go to the beginning of a line (^A) + 'Meta+ArrowRight': '\x05', // ⌘→ to go to the end of a line (^E) + 'Alt+Backspace': '\x17', // ⌥⌫ to delete a word (^W) + 'Meta+Backspace': '\x15', // ⌘⌫ to delete to the beginning of a line (^U) // copy to clipboard 'Control+Shift+C' () { screen.copySelectionToClipboard() }, + 'Control+Insert' () { + screen.copySelectionToClipboard() + }, // toggle debug mode 'Control+F12' () { @@ -229,7 +232,9 @@ module.exports = function (conn, screen) { } // ctrl+[A-Z] sent as simple low ASCII codes - for (let i = 1; i <= 26; i++) keymap[`Control+${String.fromCharCode(0x40 + i)}`] = String.fromCharCode(i) + for (let i = 1; i <= 26; i++) { + keymap[`Control+${String.fromCharCode(0x40 + i)}`] = String.fromCharCode(i) + } /** Send a literal message */ function sendString (str) {