Quantcast
Channel: how to trigger two key event at the same time
Viewing all articles
Browse latest Browse all 8

Re: how to trigger two key event at the same time

$
0
0

Sorry, I think I didn't explain my question very well.

The following is the code I make:

$("#btn").click(function () {
                var e1 = $.Event('keypress');
                var e2 = $.Event('keypress');
                e1.which = 17;  //ctrl
                e2.which = 16;  //shift$("#btn").trigger(e1).trigger(e2);
            });

I hope when I clicking the button, and then the system will invoke the event "ctrl+Shift".  The upper codes can't make that, 

Is any other way to make it, thanks.


Viewing all articles
Browse latest Browse all 8

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>