10

Where should I begin if I want users to be able to use keyboard shortcuts on a site. I'm currently using php and jquery to create site. How will I be able to add keyboard shortcuts aside from the usual point and click method. Links to site where I could begin will do. Thanks.

5 Answers 5

9

As a starter: http://plugins.jquery.com/project/hotkeys

[Edit 1/14/14: Dead link. See the Github page instead]

1
  • I see that this topic is 8 years old. Is JavaScript and a jquery hotkeys plugin still the way to do this nowadays or is there some other java-free solutions? I am thinking of creating a webapp in Python/Flask and I would like to use the the webpage as a UI which would support keyboard shortcuts. I'd like to avoid JavaScript if I can. Aug 18, 2019 at 15:47
4

Take a look at Mousetrap as well.

http://craig.is/killing/mice

It supports all types of key events as well as combinations and sequences.

2

I've used jQuery.hotkeys by John Resig, and it works pretty well with the latest jQuery. Have a look at the static page samples on the github page.

2

Maybe also look into using the accesskey attribute.

0

Try this plugin http://www.mattytemple.com/projects/shortcut-js/. It is simplistic in purpose and handles single combinations effectively.

If you need better implementation with more flexibility go for Mousetrap Plugin as specified by @craig in the previous answer.

1
  • shortcut.js is no longer working or maintained by the developer. Another +1 from me for Mousetrap. Feb 5, 2014 at 18:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.