public/Program Files/jspaint/lib/tracky-mouse/README.md
Control your computer by moving your head.
Tracky Mouse is intended to be a complete UI for head tracking, similar to eViacam, but embeddable in web applications (such as JS Paint, with its Eye Gaze Mode, which I might rename Hands-Free Mode or Facial Mouse Mode), as well as downloadable as an application to use to control your entire computer.
I'm also thinking about making a browser extension, which would 1. bridge between the desktop application and web applications, making it so you don't need to disable dwell clicking in the desktop app to use a web app that provides dwell clicking, 2. provide the equivalent of the desktop application for Chrome OS, and 3. automatically enhance webpages to be friendlier toward facial mouse input, by preventing menus from closing based on hover, enlarging elements etc., probably using site-specific enhancements.
So this would be a three-in-one project: desktop app, JavaScript library, and browser extension. Sharing code between these different facets of the project means a lot of improvements can be made to three different products at once, and the library means that applications can have a fully functional facial mouse UI, and get people interested in head tracking because they can try it out right away.
Options could be exported/imported or even synced between the products.
MIT-licensed, see LICENSE.txt
npm installsudo apt-get install libxtst-dev libpng++-dev build-essential python2.7)cd tracky-mouse-electron && npm installThe app is not yet distributed as precompiled binaries. If you want to try out the desktop app in the meantime:
tracky-mouse-electron, run npm startTracky Mouse is available on npm:
npm i tracky-mouse
<script src="node_modules/tracky-mouse/tracky-mouse.js"></script>
<script>
TrackyMouse.dependenciesRoot = "node_modules/tracky-mouse";
TrackyMouse.loadDependencies().then(function() {
TrackyMouse.init();
// This sort of logic will be built into tracky-mouse in the future.
const getEventOptions = ({x, y})=> {
return {
view: window, // needed for offsetX/Y calculation
clientX: x,
clientY: y,
pointerId: 1234567890,
pointerType: "mouse",
isPrimary: true,
};
};
TrackyMouse.onPointerMove = (x, y) => {
const target = document.elementFromPoint(x, y) || document.body;
if (target !== last_el_over) {
if (last_el_over) {
const event = new PointerEvent("pointerleave", Object.assign(getEventOptions({ x, y }), {
button: 0,
buttons: 1,
bubbles: false,
cancelable: false,
}));
last_el_over.dispatchEvent(event);
}
const event = new PointerEvent("pointerenter", Object.assign(getEventOptions({ x, y }), {
button: 0,
buttons: 1,
bubbles: false,
cancelable: false,
}));
target.dispatchEvent(event);
last_el_over = target;
}
const event = new PointerEvent("pointermove", Object.assign(getEventOptions({ x, y }), {
button: 0,
buttons: 1,
bubbles: true,
cancelable: true,
}));
target.dispatchEvent(event);
};
});
</script>
guvcview can magically fix a webcam not showing up (worked for my Logitech C920 when it wouldn't show up in applications even after restart, but was listed in lsusb) (source)