how to manage events from different devices in gtk3




hi everybody,

I am one of the maintainers of xournal (http://xournal.sourceforge.net/)

Xournal is note taking and PDF annotation software, currently using gtk2

I have been trying to port it gtk3. So far I have most of the work done,
but the area of device handling is one that I am struggling with, and
I'd very much appreciate help.

the first has to do with how to recognize the device that generated an
event. In gtk2 we used its name. What is the best way to do it?

The idea is to be able to distinguish different devices and do different
things for each, for example: touch, pen, and eraser. Here is a dump of
the devices that I see in my X220 laptop.

I can see that there is a core device that is tagged as MOUSE, and it
has many subdevices: ERASER, PEN, TOUCHPAD, MOUSE (trackpoing aka
red-nipple) and a XTEST pointer.

In an event, what is the way to distinguish each of them?

thank you for any help,

--daniel



----------------------------------------------------------------------
Describing device
->    device  [Virtual core pointer] Source [0 [MOUSE]]
Number of axis in device [2]
Axis use of this device 0 Use [0][AXIS IGNORE]
Axis use of this device 1 Use [0][AXIS X]
This is a master device
Now we describe a slave device [0] XXXXXXXXXXXXXXXX
Describing device
->    device  [Wacom ISDv4 E6 Pen eraser] Source [2 [ERASER]]
Number of axis in device [6]
Axis use of this device 0 Use [1][AXIS IGNORE]
Axis use of this device 1 Use [2][AXIS X]
Axis use of this device 2 Use [3][AXIS Y]
Axis use of this device 3 Use [4][AXIS PRESSUE]
Axis use of this device 4 Use [5][AXIS X TILT]
Axis use of this device 5 Use [0][AXIS Y TILT]
   slave device
<<< ended the slave
Now we describe a slave device [1] XXXXXXXXXXXXXXXX
Describing device
->    device  [Wacom ISDv4 E6 Pen stylus] Source [1 [PEN]]
Number of axis in device [6]
Axis use of this device 0 Use [1][AXIS IGNORE]
Axis use of this device 1 Use [2][AXIS X]
Axis use of this device 2 Use [3][AXIS Y]
Axis use of this device 3 Use [4][AXIS PRESSUE]
Axis use of this device 4 Use [5][AXIS X TILT]
Axis use of this device 5 Use [6][AXIS Y TILT]
   slave device
<<< ended the slave
Now we describe a slave device [2] XXXXXXXXXXXXXXXX
Describing device
->    device  [Wacom ISDv4 E6 Finger touch] Source [6 [TOUCHPAD]]
Number of axis in device [6]
Axis use of this device 0 Use [1][AXIS IGNORE]
Axis use of this device 1 Use [2][AXIS X]
Axis use of this device 2 Use [3][AXIS Y]
Axis use of this device 3 Use [0][AXIS PRESSUE]
Axis use of this device 4 Use [0][AXIS X TILT]
Axis use of this device 5 Use [0][AXIS Y TILT]
   slave device
<<< ended the slave
Now we describe a slave device [3] XXXXXXXXXXXXXXXX
Describing device
->    device  [TPPS/2 IBM TrackPoint] Source [0 [MOUSE]]
Number of axis in device [2]
Axis use of this device 0 Use [0][AXIS IGNORE]
Axis use of this device 1 Use [0][AXIS X]
   slave device
<<< ended the slave
Now we describe a slave device [4] XXXXXXXXXXXXXXXX
Describing device
->    device  [Virtual core XTEST pointer] Source [0 [MOUSE]]
Number of axis in device [2]
Axis use of this device 0 Use [0][AXIS IGNORE]
Axis use of this device 1 Use [0][AXIS X]
   slave device
<<< ended the slave
Scrolling Before kinetic [1]


--
Daniel M. German                  "Security is not a product
                                   that can be purchased off the shelf,
                                   but consists of policies, people,
    Kevin Mitnick ->               processes, and technology."
http://turingmachine.org/
http://silvernegative.com/
dmg (at) uvic (dot) ca
replace (at) with @ and (dot) with .

 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]