Question

Is there any way to recognise pen pressure using javascript. Preferably I don't want to make any use of Flash and try get this done as pure JS.

EDIT: okay I realised that it is kind of possible for Wacom tablets as they come with software that can work with their javascript api to make it possible (demos). But it's no good for people with Trust tablets or any other brand... So no good really.

Any body know how to do it in C# if not JS?

Was it helpful?

Solution

Yes - if the user has a Wacom tablet installed, then their browser will have a plugin for it that you can access. http://www.wacomeng.com/web/index.html

edit from author: I wrote this a very long time ago. Please see the comments below

OTHER TIPS

Microsoft implemented something called Pointer Events in IE 11. It allows you to access pressure property along with stuff like pen tilt and size of contact geometry.

So far it only works on IE11 (and IE10 with vendor prefixes) but there is a W3C candidate recommendation so maybe it will be standard in future.

No, that's not possible. Probably not even with Flash.

Javascript as a programming language in itself has no more ability or lack of ability to read this kind of data than any other language.

The language isn't important. What is important are the APIs available to you from within the language.

Javascript can be run in a number of different environments, some of which may possibly have access to APIs for this kind of hardware. However most Javascript is run in a web browser environment, and this is clearly what you mean.

The web browser environment provides a number of APIs. The most obvious is the DOM, which gives you the ability to manipulate the page, etc. There are other APIs available in the browser as well though. For example, the Geolocation API.

All these are standard APIs which have been defined by the W3C (or in some cases are in the process of being defined by the W3C), meaning that all browsers that support them should make them work the same way.

Unfortunately for you there isn't a standard API for working with pressure pads, so the direct answer to your question is no, it can't be done.

Whether one will become available in the future remains to be seen, but I have my doubts.

There is one way that you can do it though: ActiveX.

ActiveX is an API provided by Microsoft in older versions of IE. It basically provides a way of accessing virtually any Windows DLL code from within the browser.

Since the pressure pen device driver for Windows will be provided as a DLL, this means you should theoretically be able to access it in the browser via an ActiveX control. So therefore yes, you would be able to program it using Javascript.

The bad news, though, is that this is not something I'd recommend. ActiveX as a browser-based technology has long since been abandoned, due to the massive security holes it caused. I don't think the latest versions of IE even support it (I hope not, anyway), which means you'd be forced to use old versions of IE (and only IE - no other browser ever supported it) in order to run your code. Not ideal.

You can only do so in an Native app. Javascript does not have access to pen pressure information

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top