From d4305c3b7a6a5b4ac4ff2d9dfcc8631116ca7627 Mon Sep 17 00:00:00 2001 From: fl0l0u <16851037+fl0l0u@users.noreply.github.com> Date: Sat, 29 Jul 2017 15:42:39 +0200 Subject: [PATCH] Fix Issue #40 Special characters combinations on non US keyboards are marked as ev.ctrlKey == true and ev.altKey == true (eg. 'AltGr' + '(' => '[' on fr-FR keyboard). --- lib/web_console/templates/console.js.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/web_console/templates/console.js.erb b/lib/web_console/templates/console.js.erb index b8faa3a5..a02c3c2e 100644 --- a/lib/web_console/templates/console.js.erb +++ b/lib/web_console/templates/console.js.erb @@ -732,7 +732,7 @@ REPLConsole.prototype.onKeyDown = function(ev) { */ REPLConsole.prototype.onKeyPress = function(ev) { // Only write to the console if it's a single key press. - if (ev.ctrlKey || ev.metaKey) { return; } + if (ev.ctrlKey && !ev.altKey || ev.metaKey) { return; } var keyCode = ev.keyCode || ev.which; this.insertAtCurrent(String.fromCharCode(keyCode)); ev.stopPropagation();