Add Escape and Alt+L keyboard shortcuts

* Escape: disconnect
  * Alt+L: focus on input bar
This commit is contained in:
Philippe Proulx 2013-10-27 04:57:56 -04:00
parent 0f1bde187a
commit 2101e52131
1 changed files with 16 additions and 0 deletions

View File

@ -650,6 +650,22 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
return true;
}
// Alt+L -> focus on input bar
if ($event.altKey && (code == 76 || code == 108)) {
$event.preventDefault();
var inputNode = document.getElementById('sendMessage');
inputNode.focus();
inputNode.setSelectionRange(inputNode.value.length, inputNode.value.length);
return true;
}
// Escape -> disconnect
if (code == 27) {
$event.preventDefault();
connection.disconnect();
return true;
}
// Ctrl+G -> focus on buffer filter input
if ($event.ctrlKey && (code == 103 || code == 71)) {
$event.preventDefault();