按Enter键,然后自动按Shift + Tab键

时间:2019-03-11 21:21:10

标签: javascript jquery keyboard jquery-events

当我按Enter键时如何直接按Control + Shift键?

'activeKeyboard' : function($list){
  var that = this;

  $list.on('focus', function(){
    $(this).addClass('ms-focus');
  })
  .on('blur', function(){
    $(this).removeClass('ms-focus');
  })
  .on('keydown', function(e){
    switch (e.which) {
      case 40:
      case 38:
        e.preventDefault();
        e.stopPropagation();
        that.moveHighlight($(this), (e.which === 38) ? -1 : 1);
        return;
      case 13:
        e.preventDefault();
        e.stopPropagation();
        that.selectHighlighted($list);
        return;
      case 37:
      case 39:
        e.preventDefault();
        e.stopPropagation();
        that.switchList($list);
        return;
    }
  });
},

0 个答案:

没有答案