Question

Alright so for my website I'd like to enable keyboard shortcuts. When left or right button is pressed on the keyboard, it opens an URL. Also binding some other buttons too maybe.

Any clue how I can go about doing this?

Was it helpful?

Solution

Using the javascript onkeydown event and getting the key code.

Or using a jQuery-plugin like hotkeys which offers key combinations like ctrl+c.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top