css-only-chat icon indicating copy to clipboard operation
css-only-chat copied to clipboard

Use accesskey to reimplement the keyboard

Open shark0der opened this issue 5 years ago • 4 comments

You can use HTML attribute accesskey to access the elements on the page. I've put together a small demo here: https://jsfiddle.net/x4ek56pc/

I've used jQuery in my example but that's just for the purpose of demonstration and it is not required for the accesskey to work.

shark0der avatar May 08 '19 10:05 shark0der

https://www.w3schools.com/tags/att_global_accesskey.asp

shark0der avatar May 08 '19 10:05 shark0der

Very nice! Yeah, I'm pretty confident that accesskey is the missing piece I'd need to make this a lot smoother. I'm not sure exactly when I'll come back to this - maybe on some upcoming train rides, but I'd love to rewrite it around that concept. :)

kkuchta avatar May 08 '19 11:05 kkuchta

You can use HTML attribute accesskey to access the elements on the page. I've put together a small demo here: https://jsfiddle.net/x4ek56pc/

I've just tested your fiddle on Firefox 116 on Manjaro GNOME and it does not work; Alt+B gets inhibited by the browser to open the drop-down bookmarks menu. Alt+A does nothing, as does A and B.

KataFF avatar Aug 13 '23 17:08 KataFF

Oh, never mind, just checked and the key combo for accesskeys is different on Firefox (see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/accesskey )

It does work with Alt+Shift+A/B

KataFF avatar Aug 13 '23 17:08 KataFF