Improved keybindings
This commit is contained in:
parent
67375a2600
commit
c78c577637
@ -462,17 +462,25 @@ $(function() {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
Mousetrap.bind(["ctrl+up", "ctrl+down"], function(e, keys) {
|
Mousetrap.bind([
|
||||||
var active = sidebar.find(".active");
|
"command+up",
|
||||||
switch (keys) {
|
"command+down",
|
||||||
case "ctrl+up":
|
"ctrl+up",
|
||||||
var prev = active.prev(".chan");
|
"ctrl+down"
|
||||||
prev.click();
|
], 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;
|
break;
|
||||||
|
|
||||||
case "ctrl+down":
|
case "down":
|
||||||
var next = active.next(".chan");
|
var i = Math.min(channels.length, index + 1);
|
||||||
next.click();
|
channels.eq(i).click();
|
||||||
break;
|
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 38: // Up
|
||||||
case 40: // Down
|
case 40: // Down
|
||||||
if (e.ctrlKey) {
|
// NOTICE: This is specific to the Shout client.
|
||||||
|
if (e.ctrlKey || e.metaKey) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
history[i] = self.val();
|
history[i] = self.val();
|
||||||
|
Loading…
Reference in New Issue
Block a user