Key Shortcuts on a web page
-
13-12-2019 - |
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?
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.
OTHER TIPS
Try out this page:
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow