DEV Community

Discussion on: 101 Digital Accessibility (a11y) tips and tricks

 
grahamthedev profile image
GrahamTheDev

Yeah exactly, if it works for keyboard it will probably work for switch controls reasonably well.

However I am intrigued to see what things you did / how you tackled it and will read your article when I get back to the UK in a couple of days. Looking forward to it! 🔥

Thread Thread
 
jameslivesey profile image
James Livesey

Yeah; the implementation that I made mainly emulates the Tab keyboard event to scan to the next item, much like on a keyboard. Pressing Space would of course interact the focused item, which relies on the default behaviour of that key on elements (might need to address pressing Space on things like range sliders, links etc. that don't do anything when pressed though 🤣). Switches typically act like keyboards in that they typically send the Space event when pressed, so that essentially completes the system.

There's also things like point scanning (which was talked about briefly in the post) which emulates things like mouse/touch events, too. Not too hard to implement once key emulation works!

Safe travels as you get back to the UK!