Page MenuHome

Fix for T40621 (Tablet usable with walk mode)
Needs ReviewPublic

Authored by Campbell Barton (campbellbarton) on Jun 18 2014, 1:07 PM.



This script makes tablets (absolute pointing device) usable in walk-mode.

Im not totally happy with this because if you don't have your cursor around the center of the view - the operator starts rotating.

However AFAICS the only way to detect tablet events is to check the first mouse-move event. which isn't available when walk mode starts.

So this is a bit of a compromise. its not ideal but it is usable. see: T40621

Probably a better way to resolve this would be to postpone warping the mouse-cursor until the first mousemove event - where we can detect if a tablet is used or not.
But I'd rather not make really big changes to walk mode. just for this case.

Diff Detail

Event Timeline

@Campbell Barton (campbellbarton) I'll be away from my Bamboo tablet until next week, but a question in the meanwhile: I thought tablets could also be setup with relative cursor position. Your fix assumes event->tablet_data == using absolute. I'll double-check that in my bamboo once I test this patch.

@Dalai Felinto (dfelinto), your right, this seems less common convention but we probably shouldnt ignore.

In that case I see no other option then to have some preference to enable Absolute position cursor, but since you can mix both mouse & tablet use. it seems a bit weak.
Maybe option to select absolute tablet only?

I think most people are using tablets in absolute mode, since the main advantage of the tablet over the mouse is its precision. I'm always using my tablet together with mouse. Sometimes I'm even using the buttons or the wheel on the mouse while positioning with the tablet... With Wacom tablets, you can set the absolute/relative mode for each tools separately (ie. pen, eraser, puck etc., even you can use different pens) and as I remember you can ask these settings from the driver. You need the absolute mode for Cintique tablet-monitors too.

AFAIK, it is not possible to switch between absolute and relative modes from software.

There is a very similar hack in the Ghost module too for the case when the mouse goes out at one side of the window and comes in at the other side.

I've tried this patch and I think it is still not perfect, but maybe I just have a different idea how this should work. In relative mode the picture is moving only if you move the mouse. In absolute mode with the tablet (I've checked, it switches the is_absolute_cursor on) it's constantly rotating. The rotation's direction and speed depends on the distance from the tablet's center. Nicely usable however, but this is a completely different behaviour comparing to the relative mode. I think using the distance from the previous motion event and offset these coordinates to the center could be better.

@Fazekas Laszlo (totoro) - issue with only moving the view when the cursor moves, is you hit the side of the tablet and you can't turn your head any further.

IMHO this mouselook isn't well suited for tablets and not sure how much effort its worth to make it work.

Other options.

  • Accept that your view is limited by tablet bounds (accelerate when tablet is used so you can at least turn your head 180)
  • Attempt to detect when user takes pen of tablet and repositions (fake relative movement) - ignore jumps of ~100>px. not reliable with slow redraw though.

Another solution could be to switch the tablet into relative mode temporally, but I think it is not possible through the driver. Under Linux, there is a command line tool to do this (xsetwacom) so perhaps it is possible but very complicated and a lot of potential bugs. The fake relative mode is exactly what the tablet driver does internally. It is working through the proximity event. This event happens if the user moves away the pen from the tablet (proximity out) or puts the pen onto the tablet (proximity in).

@Campbell Barton (campbellbarton): I've made a version based on your diff for your first option (limited by tabled bounds). I prefer this version, also tried it with my tablet and mouse, but of course the choice is yours.