halvves / webmonome

we've moved to sourcehut! this is just a mirror of: https://sr.ht/~merl/webmonome/
https://www.npmjs.com/package/webmonome/v/alpha
MIT License
11 stars 1 forks source link

Standardise Event System #9

Closed domchristie closed 2 years ago

domchristie commented 2 years ago

This pull request standardises the event system in accordance with other Web APIs. The standardisation could enable the creation of grid-like devices with an identical API, without the need to duplicate or adapt the event system.

For example, let's say we created a grid-like device that used qwerty input. We can use the standard addEventListener to create apps that work with this grid-like device, as well as webmonome.

halvves commented 2 years ago

Ah yeah! I like this a lot. I avoided CustomEvent out of my habit of usually going for deep backwards compatibility, but considering this is using WebUSB, CustomEvent is the least of our concerns lol.

Thanks for all of the continued great ideas and contributions!

domchristie commented 2 years ago

Thanks! This is currently in use on https://taperinstruments.github.io/svemlr/ which utilises: https://github.com/taperinstruments/qwerty32