this is going back a bit but...
it would depend on the OS of course, but i'd guess the best way to do it would be to have the pressure applied to the buttons measured the same way as analog sticks, and i'd assume that just like an analog stick, it would report a varying value on polling (maybe normalised between 0 and 1f?) rather than just 1 or 0.
i.e for a drawing tablet, button1.getpolldata() may give 0 for the pen not touching the tablet, 0.10 for lightly resting, and 1.0 for the user pressing hard on the tablet... given the vast array of diferent controllers for PC's, i would consider this a novelty really. maybe a 1.5 feature?
Graphics tablets report MUCH more than just pressure
. e.g. a typical modern standard tablet (something you could get for under $100) will have:
- pressure on a scale typically 0-1024, possibly 0-32768 if you have an expensive one
- secondary-pressure (i.e. turn the pen upside-down and use the "eraser" end, and that too is pressure-sensitive)
- tilt (degrees from the vertical of the pen! Yes, it's very cool when you get used to it
), typically 0-256, or bigger range if you have a more expensive tablet
- almost all wacom tablets also support their "airbrush" pen which is fairly often used as a replacement for a lost pen because retailers often sell out of "normal" pens
and the airbrush is pretty much the same. Airbrush pens have an extra sensor, a "mouse wheel" with a limited range (i.e. like a volume knob you can only spin it through a limited degrees; this equates to how much paint you wish to spray per second). Again, this supports a range typically 0-256 IIRC.
Note: tablets have to contend with a lot of abuse, and so the "pressure" sensitivity is usually dodgy. You get a lot of false positives and negatives in the low pressure range, so OS drivers typically have a "threshold" below which the driver ignores the signal. e.g. for 0-1024 you would have a threshold recommended by manufacturer of 30 or similar.
If you crank that down to 10 your tablet starts doing weird stuff
. I guess if you have an RFI-free environment you can perhaps get away with lower values?
Which means...typically they will return pressure STARTING at 30 - you'll never see "0-29". I have yet to experiment to see how this gets reported into JInput, but previous experiments with linux drivers in debug mode suggests they supply the pressure untranslated; so you do indeed see nothing below 30. In that case, it might help if JInput had some minor feature to support detection of thresholds and perhaps an auto-translation of the range? I have no idea how the hw drivers report the current threshold (i.e. whether or not there is a standard) I just know that they do.
I for one think that supporting tablets in all their glory is an excellent idea (and not jsut because I have some
). In the last few years they've become very cheap, and the $50 A5 tablets are an excellent replacement for a mouse. If you don't think gamers would use them, well...my flatmate used to keep nicking mine to play that Yahoo game where you have to draw a word for other people to guess. He said it made a huge difference
It may sound silly, but when something as mainstream as Yahoo games has a game that rewards tablets its worth considering that there could well be more tablet-games appearing IF they were easy to write for.
It's a bit like explicitly dual-screen games (of which a handful appeared 5 years ago)...the games are there, even if they haven't achieved mainstream hardware support yet. Multi-monitor setups are still too expensive for most gamers, but a $50 tablet is a much lower barrier.
Anyway...AFAICS there needs to be no special support for tablets because AIUI they just report their stuff as various axes, and that's presumably exactly what we want?
(nb: as soon as I re-install my linux machine I'll test some of these exotic features with windows and linux; can't at the moment because the latest WACOM drivers need a new kernel to be compiled, and my kernel's broken