Some suggestions
Opened this issue · 1 comments
Really cool idea -- MM would be much more usable with some kind of input, be it touch, voice, or IR (e.g., remote control).
Some suggestions:
- Consider using a proven gesture library (hammer.js is very popular)
- A module would need to register its DOM element so it receives only touch events for itself and not for other modules. Perhaps
// In some other module.
// Access MMM-AirbarHelper with MM.getModules(), then
let airbar = airbarHelper.register(myDOMEl, config);
airbar.on('pan', function(){
// take action
});
- This gives more control to the caller if they want to take advantage of hammer's capabilities.
- Add a
.gitignore
file to your repo so thatnode_modules
doesn't get checked in :)
Hi Moos! Thanks for the suggestions. I went ahead and added the gitignore as that's an easy improvement.
I'll look into hammer and other gesture libraries when I have more time.
I like your suggestion of registering it per module, but I'm not sure it'll work exactly as suggested. A downside the airbar has to something like an IR frame is that for most users I don't expect it to be able to accurately determine where the touch is within the mirror. That might be fixable with some calibration, but the airbar is designed for very specific dimension monitors that are smaller than most. I've been using it so one touch input goes to the whole system. I've considered making a specical command (say double tap) so the user can change the module the touch inputs are sent for, but I personally haven't had a need so I've kept it on the backburner.