Way to trigger multiple keypress and hold events in jQuery

Looking for a way to simulate a multiple keypress using jQuery. For example ALT+F1 (holding down alt and hitting F1). I've managed to simulate the F1 keypress thanks to: Looking for something like this: $(".f1").click(function() { var e = jQuery.Event("keydown"); e.keyCode = 18; // ALT key pressed // while ALT key is pressed, hit the F1 Key $("input").trigger(e, function(){ var e = jQuery.Event("keydown"); e.which = 112; // F1 key $("input").trigger(e); }); });

以上就是Way to trigger multiple keypress and hold events in jQuery的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » jQuery 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏