Search code examples
javascriptc#winformswebbrowser-controlhammer.js

Hammer.js not working embedded in c# WebBrowser


My setup: I have an embedded .net Forms WebBrowser implementation, and a website using Hammer.js to enable using both touch and mouse events.

The .net Forms.WebBrowser implementation is default, just displayed on a form.

My OS is Windows 10, so the embedded WebBrowser should work more or less as IE11?

The Issue: My issue is that no Hammer.js events seem to work in the embedded browser (tested using mouse). I have also tested embedding the example page http://hammerjs.github.io/#try-it - and nothing there seem to work either!

Does anyone know why no javascript events seem to be firing and how I can fix it?


Solution

  • It is possible to set a flag in the registry to tell IE (our embedded browser) not to use Legacy Input Model (which, apparently, is default on). The registry key is FEATURE_NINPUT_LEGACYMODE and more info can be found here. This will solve the issue.