Quick keys disappear only after releasing alt key

Other changes:
- 0.2s delay so they don't appear when pressing Alt+A etc
- don't appear when other modifier keys are pressed
This commit is contained in:
Lorenz Hübschle-Schneider 2014-10-20 11:40:30 +02:00
commit 80b0d2ca6a
2 changed files with 16 additions and 15 deletions

View file

@ -362,9 +362,16 @@ weechat.directive('inputBar', function() {
$event.preventDefault();
return true;
}
// Alt key down -> display quick key legend
if ($event.type === "keydown" && code === 18) {
if ($event.type === "keydown" && code === 18 && !$event.ctrlKey && !$event.shiftKey) {
$rootScope.showQuickKeys = true;
}
};
$rootScope.handleKeyRelease = function($event) {
// Alt key up -> remove quick key legend
if ($event.keyCode === 18) {
if ($rootScope.quickKeysTimer !== undefined) {
clearTimeout($rootScope.quickKeysTimer);
}
@ -374,18 +381,10 @@ weechat.directive('inputBar', function() {
$rootScope.$apply();
}
delete $rootScope.quickKeysTimer;
}, 3000);
}, 1000);
return true;
}
};
$rootScope.handleKeyRelease = function($event) {
// Alt key up -> remove quick key legend
if ($event.keyCode === 18) {
if ($rootScope.showQuickKeys) {
$rootScope.showQuickKeys = false;
}
}
};
}]
};
});