The "Lookit!" crate checks for new devices in a cross-platform asynchronous
manner. Returns the smelling_salts RawDevice
for the target platform.
- Linux: inotify on /dev/*
- Web: JavaScript event listeners
- Others: TODO
Getting Started
# use Lookit;
async
block_on;
Implementation
Input
- inotify => /dev/input/event*
- window.addEventListener("gamepadconnected", function(e) { });
Audio
- inotify => /dev/snd/pcm*
- navigator.mediaDevices.getUserMedia(constraints).then(function(s) { }).catch(function(denied_err) {}) // only one speakers connection ever
MIDI
- inotify => /dev/snd/midi*, if no /dev/snd then /dev/midi*
- https://developer.mozilla.org/en-US/docs/Web/API/MIDIAccess
Camera
- inotify => /dev/video*
- navigator.mediaDevices.getUserMedia(constraints).then(function(s) { }).catch(function(denied_err) {})