0

I want to send a combination keystroke to the browser using Javascript. For example, CMD + A. I tried this, but it doesn't seem to work. (Tested in Safari).

Community
  • 1
  • 1
Max Isom
  • 98
  • 3
  • 11

1 Answers1

0

I highly recommend mousetrap.js. It's intuitive, lightweight and very easy to use;

Edit: See this answer. Note that CMD+A (or any other combination) is not really both together - it's a keydown event for both before there is a keyup for either.

Community
  • 1
  • 1
Etai
  • 1,483
  • 1
  • 11
  • 15
  • I don't want to **detect** keyboard events, I want to **send** them to the browser. mousetrap.js does look great for detecting shortcuts, but that's not what I want to do. – Max Isom Sep 23 '14 at 19:52
  • I updated my answer to include a link to http://stackoverflow.com/questions/961532/firing-a-keyboard-event-in-javascript which looks like what you're looking for. – Etai Sep 23 '14 at 19:57
  • Those examples don't show how to do a combination keystroke. – Max Isom Sep 24 '14 at 18:56