romeboards
romeboards

Reputation: 397

Is there any way to distinguish touch vs. mouse interactions in Windows 8 (HTML/JS)

I'm currently building an app that has lots of emphasis on panning, which looks and feel beautiful when touched and manipulated. However, when using a mouse, with the typical Microsoft 'blocky' touchwheel, the panning obviously has the same 'blocky' panning effects. Is there any way to detect the different input when developing for windows 8, seeing as how the JS events are now bundled under the same 'MSPointer' name, so I can account for the scrolling behavior differently?

Upvotes: 3

Views: 922

Answers (2)

Sam K
Sam K

Reputation: 143

I've been wrestling with the same problem and have discovered that there is actually a way to distinguish the input type using the non-standard "pointerType" property of the event. Admittedly, romeboards mentions "app", and this seems like a JavaScript/IE10 solution so I'm not sure if it's appropriate to their problem.

http://msdn.microsoft.com/en-gb/library/ie/hh772359(v=vs.85).aspx

I know this is an old(-ish) question but it came up early when I was looking for a solution, so I thought I'd add the info.

Upvotes: 1

romeboards
romeboards

Reputation: 397

Solved my problem specifically within my JS code... when monitoring the scrolling action, I keep track of the previous scroll position as well as the current scroll position, by monitoring how quickly this grows or falls, I determine if the user is using smooth 'pixel-by-pixel' scrolling devices (touch or a smooth scrolling mousewheel) or if they are using a 'blocky' mousewheel. As far as solving this problem in general, there doesn't seem to be a Microsoft supported solution..

Upvotes: 1

Related Questions