Mouse events in Deno
Beware: FFI requires --unstable
Works on Windows, Mac and Linux (X11). click
events are only support on Linux
devices with /dev/input/mice
character device.
import { init } from "https://deno.land/x/mouse/mod.ts";
window.addEventListener("mousemove", (e) => {
console.log(e.screenX);
});
// `click` is only supported on Linux
window.addEventListener("click", (e) => {
console.log(e.buttons);
});
await init();
License
MIT