#StackBounty: #javascript #dom-events How do I simulate a cross browser key press that works for alphanumeric and non-printable charact…

Bounty: 500

This is a more specific question of Is it possible to simulate key press events programmatically? Every answer is missing the following information in one way or another, reducing the question’s value. I’ve tried three things on there already that didn’t work in modern browsers, or were advised against by official sources.

I want this question to be the one stop

Here is what I’m looking for:

  1. At the time of answering, every example should work in modern versions of Firefox and Chrome.
  2. No examples include deprecated objects, fields, properties, or functions.
  3. Every answer should include a way of typing a printable character in a textfield and textarea. As mentioned in a comment below, this can’t be done.
  4. Every answer should include a way to type an alphanumeric character when an input does not have focus. e.g., "a", "b", "c", etc.
  5. Every answer should include a way to type a non-printable character. e.g., page down, left arrow, the F1 key (if this isn’t possible, it’s okay to state so), Enter, etc.
  6. Every answer should include a link to all the "codes" needed to simulate alphanumeric characters and non-printable characters, or even better, embed that info into the answer. I’m using the term "codes" loosely here: I mean whatever term is appropriate to to satisfy the 2nd point.


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.