I'm working on a blog theme & I'd like to have keyboard navigation. I know it has something to do with the id of the keyboard keys, but I've looked for I think 3 hours now and still have not found an easy solution. Here are the keys that I'd like to press & what I'd like them to do.
- J - Scroll down to next post
- K - Scroll up to previous post
- R - Opens a new tab with THAT post's reblog URL
- P - Opens a new tab with THAT post's permalink URL
If anyone could help me with this it would be extremely helpful. Also, I know you can do something by setting the links up in the URL like <article data-reblog-url="http://reblogurl" data-permalink-url="{Permalink}">
but I have no clue how to make the browser open a new tab when the R & P keys are pressed with that data as the URL. Also, the J & K, I'd like the browser to smooth scroll to the top of the post including the post's margin-top.
If anyone could help me with the whole code I would appreciate it a TON. I know it's a lot and I'm probably going to get thumbs down for this, but like I said I've been trying for more than an hour and I just need an expert's help.