1

I'm using a chrome plugin in my Mac OS which executes javascript automatically when a page loads. I'm able to simulate single keystroke easily.

But I need to simulate multiple keystrokes at a time ("Command"+",")

  • Does this answer your question? [Is it possible to simulate key press events programmatically?](https://stackoverflow.com/questions/596481/is-it-possible-to-simulate-key-press-events-programmatically) – CerebralFart May 11 '20 at 12:56
  • @CerebralFart, That link too provides only single keystroke solution, whereas my requirement is to simulate 2 keystrokes at a time simultaneously – Nikhil Reddy May 11 '20 at 12:59
  • Command isn't really a keystroke tho, you cannot pick it up independently. Instead, it is passed as the meta key modifier (similar to control, alt or shift). Also check the documentation on MDN: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent – CerebralFart May 11 '20 at 13:03
  • In that case, consider this scenario as "simulating 'comma' along with Metakey in javascript" – Nikhil Reddy May 11 '20 at 13:24

0 Answers0