Just test

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// ==UserScript==
// @name FF.Mixxer.VK.MsgTabKey
// @version 0.02
// @grant none
// @author DJ_miXxXer
// @include http://vk.com/im*
// @include https://vk.com/im*
// @namespace http://dj-mixxxer.spaces.ru
// @require http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js
// ==/UserScript==
$(document).ready(function() {
console.log("FF.Mixxer.VK.MsgTabKey loaded...");
var djvk_countTotal = 0, djvk_selected = 0;
var djvk_getCounters = function(e) {
e.preventDefault();
djvk_countTotal = $('#im_tabs').children().length - 1;
djvk_selected = $('#im_tabs').find('.im_tab_selected').index();
};
$(document).keydown(function (e) {
if (e.ctrlKey && e.witch == 65) {
djvk_getCounters.call(this, e);
$('#im_tabs').children(':eq(' + (djvk_selected == 0 ? djvk_countTotal : djvk_selected - 1) + ')').click();
}
if (e.ctrlKey && e.which == 83) {
djvk_getCounters.call(this, e);
$('#im_tabs').children(':eq(' + (djvk_selected == djvk_countTotal ? 0 : djvk_selected + 1) + ')').click();
}
});
});