mirror of
https://github.com/thelounge/thelounge
synced 2024-11-26 22:10:22 +00:00
Improved keybindings
This commit is contained in:
parent
67375a2600
commit
c78c577637
3 changed files with 20 additions and 11 deletions
|
@ -462,17 +462,25 @@ $(function() {
|
|||
);
|
||||
});
|
||||
|
||||
Mousetrap.bind(["ctrl+up", "ctrl+down"], function(e, keys) {
|
||||
var active = sidebar.find(".active");
|
||||
switch (keys) {
|
||||
case "ctrl+up":
|
||||
var prev = active.prev(".chan");
|
||||
prev.click();
|
||||
Mousetrap.bind([
|
||||
"command+up",
|
||||
"command+down",
|
||||
"ctrl+up",
|
||||
"ctrl+down"
|
||||
], function(e, keys) {
|
||||
var channels = sidebar.find(".chan");
|
||||
var index = channels.index(channels.filter(".active"));
|
||||
|
||||
var direction = keys.split("+").pop();
|
||||
switch (direction) {
|
||||
case "up":
|
||||
var i = Math.max(0, index - 1);
|
||||
channels.eq(i).click();
|
||||
break;
|
||||
|
||||
case "ctrl+down":
|
||||
var next = active.next(".chan");
|
||||
next.click();
|
||||
case "down":
|
||||
var i = Math.min(channels.length, index + 1);
|
||||
channels.eq(i).click();
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
|
2
client/js/libs.min.js
vendored
2
client/js/libs.min.js
vendored
File diff suppressed because one or more lines are too long
3
client/js/libs/jquery/inputhistory.js
vendored
3
client/js/libs/jquery/inputhistory.js
vendored
|
@ -49,7 +49,8 @@
|
|||
|
||||
case 38: // Up
|
||||
case 40: // Down
|
||||
if (e.ctrlKey) {
|
||||
// NOTICE: This is specific to the Shout client.
|
||||
if (e.ctrlKey || e.metaKey) {
|
||||
break;
|
||||
}
|
||||
history[i] = self.val();
|
||||
|
|
Loading…
Reference in a new issue