Re: Where are pressure and tilts initialized ?
- From: David Bourguignon <David Bourguignon imag fr>
- To: gtk-devel-list gnome org
- Cc: Owen Taylor <otaylor redhat com>
- Subject: Re: Where are pressure and tilts initialized ?
- Date: Fri, 24 Aug 2001 21:07:51 +0200
Owen Taylor wrote:
>
> Well, in GTK+-1.2, you'd look in gdk/gdkinputcommon.h,
> in GTK+-1.3.x, you'd look in gdk/x11/gdkinput-x11.c.
Hi all,
Thank you Owen for your answer.
I've encountered problems porting gdk to sgi irix (for testing purposes, I'm
using scribble-xinput.c). I describe you the main problems, any hint on them is
very much appreciated:
1) The least important problem is the only one I solved :-(
It's about tilt valuators. With my sgi wacom driver, I get tilt values between
1031.11... and 0.94... which is far from useful. That is caused by an
unfortunate conversion from unsigned to float and a wrong normalization.
In fact, sgi driver gives tilt value varying between -60 and +60 degrees but the
range registered by Xinput is between -64 and +63 which causes wrong normalized
values.
Here is my (straightforward) correction in gdkinputcommon.h to get tilt values
between -60 and +60 degrees (thus not normalized):
#if 0 /* original gdk implementation */
*xtilt = 2. * (double)(axis_data[xtilt_axis] -
(gdkdev->axes[xtilt_axis].min_value +
gdkdev->axes[xtilt_axis].max_value)/2) /
(gdkdev->axes[xtilt_axis].max_value -
gdkdev->axes[xtilt_axis].min_value);
#else /* my correction */
*xtilt = (double) ((short) axis_data[xtilt_axis]);
#endif
I wonder how it can work under linux if its normalization is wrong too (as far
as I remember, the device also says its range is -63 to +64...)
2) I observe a shift between X11 pointer icon (arrow head) position and the
pixels where I'm drawing. This shift is in y direction only and is varying
according to current y position in root window (full screen window). The
smallest shift is observed when y_root is near 0. Even if it seems
straightforward to debug, I wasn't successful at it.
3) There is a fundamental difference between the two drivers: with sgi's, I have
only one device named "wacom" which has a valuator to give information about
current transducer, such as:
switch (axis_data[WAC_TRANSDUCER_I] & WAC_TRANSDUCER_MSK) {
case WAC_STYLUS_ID:
/*gdkdev->info.source = GDK_SOURCE_PEN;*/
break;
case WAC_ERASER_ID:
/*gdkdev->info.source = GDK_SOURCE_ERASER;*/
break;
case WAC_PUCK_ID:
/*gdkdev->info.source = GDK_SOURCE_CURSOR;*/
break;
}
With linux's, I have three different devices with different names ("pen",
"eraser", "cursor" for example). In gdkinputcommon.h, a device named "wacom" is
considered as a pen device. All my attempts to get around this failed.
4) When selecting my "wacom" device with GtkInputDialog, the "window mode"
doesn't give any output. I have no idea why and where it is stuck.
5) After setting printf() traps, I realized that
gdk_input_translate_coordinates() is always called twice for each motion event.
Sometimes the first call gives slightly different x and y position values than
the second call and sometimes the first call gives wildly different values
(negative ones) but this has no influence on the resulting output.
Sorry for this long post and thank you in advance,
David.
--
iMAGIS project, GRAVIR lab
INRIA Rhône-Alpes, 655 avenue de l'Europe
38330 Montbonnot Saint Martin, France
http://www-imagis.imag.fr/~David.Bourguignon/index.gb.html
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]