I see that the google doc can use many desktop short key, it seems that it listen to the keyboard you type. How can I implement it using javascript? Thank you.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use the keydown event:
Note that this example uses jQuery. It can also be done without jQuery but event handling is not exactly the same in all browsers so I’d highly suggest you to use jQuery or another Javascript framework.