
Security News
The Code You Didn't Write Is Still Yours to Defend
AI agents are pulling packages into environments no scanner is watching, creating exposure before security teams can see it.
@sunoj/touchemulator
Advanced tools
Emulate multi-touch input on your desktop. Triggers touch events as
specified by W3C. Press the shift key to pinch and rotate!
Download the script from this repo, via Bower:
bower install hammer-touchemulator
or NPM:
npm install hammer-touchemulator
Include the javascript file, and call the Emulator() function before any other libraries that do something with the
touch input. It will set some fake properties to spoof the touch detection of some libraries, and triggers touchstart, touchmove and touchend events on the mouse target.
<script src="touch-emulator.js"></script>
<script> TouchEmulator(); </script>
function log(ev) {
console.log(ev);
}
document.body.addEventListener('touchstart', log, false);
document.body.addEventListener('touchmove', log, false);
document.body.addEventListener('touchend', log, false);
Also, the script includes polyfills for document.createTouch and document.createTouchList.
It listens to the mousedown, mousemove and mouseup events, and translates them to touch events. If the mouseevent
has the shiftKey property to true, it enables multi-touch.
The script also prevents the following mouse events on the page:
mousedown, mouseenter, mouseleave, mousemove, mouseout, mouseover and mouseup.
The script has been tested with the w3c web platform tests and passes all tests, except these;
Eventjavascript:!function(a){var b=a.createElement("script");b.onload=function(){TouchEmulator()},b.src="//cdn.rawgit.com/hammerjs/touchemulator/0.0.2/touch-emulator.js",a.body.appendChild(b)}(document);
Change the css properties of the rendered touches.
The distance between the two touch points when entering the multi-touch zone.
FAQs
Emulate touch input on your desktop.
We found that @sunoj/touchemulator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
AI agents are pulling packages into environments no scanner is watching, creating exposure before security teams can see it.

Security News
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.