Wern Ancheta
Wern Ancheta

Reputation: 23297

How to implement keyboard shortcuts on websites

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.

Upvotes: 10

Views: 22129

Answers (5)

rik
rik

Reputation: 8612

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

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

Upvotes: 9

Vignaz
Vignaz

Reputation: 41

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.

Upvotes: 0

Craig
Craig

Reputation: 2704

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.

Upvotes: 4

uvtc
uvtc

Reputation: 720

Maybe also look into using the accesskey attribute.

Upvotes: 2

Dogbert
Dogbert

Reputation: 222158

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.

Upvotes: 2

Related Questions