Mouse events in Deno

Beware: Native plugins are --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();

Buy Me a Coffee at ko-fi.com

License

MIT