From 64f412e047836dad36883bde53988bf1de816351 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Sun, 10 Aug 2014 16:57:58 +0100 Subject: [PATCH 1/2] Handle keypress events as well keydown is not enough, because browsers. A (very very very) long explanation that I read in part is at http://unixpapa.com/js/key.html E.g. on my keyboard layout (neo2), I don't get a keydown event for alt+<, which in QWERTY keys is alt + caps lock + u (or the key above shift next to enter on the right side, which actually isn't present on QWERTY (not ' but to the right of it - it's not there on a US layout, but it is # on QWERTZ). I do get a keypress event though. --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index ebfc3c8..d4df8b6 100644 --- a/index.html +++ b/index.html @@ -29,7 +29,7 @@ - +

logo From 9501b9f3d3355aeef8964efbdb050221724ffbcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Sun, 10 Aug 2014 18:59:15 +0100 Subject: [PATCH 2/2] Fix history keybindings for keypress because ASCII != keydown code in JS m( --- js/glowingbear.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/glowingbear.js b/js/glowingbear.js index d7e6500..98a96ae 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -1604,7 +1604,7 @@ weechat.directive('inputBar', function() { } // Arrow up -> go up in history - if (code === 38) { + if ($event.type === "keydown" && code === 38) { $scope.command = models.getActiveBuffer().getHistoryUp($scope.command); // Set cursor to last position. Need 0ms timeout because browser sets cursor // position to the beginning after this key handler returns. @@ -1617,7 +1617,7 @@ weechat.directive('inputBar', function() { } // Arrow down -> go down in history - if (code === 40) { + if ($event.type === "keydown" && code === 40) { $scope.command = models.getActiveBuffer().getHistoryDown($scope.command); // We don't need to set the cursor to the rightmost position here, the browser does that for us return true;