Qt-interest Archive, May 2008
tabletEvent
Message 1 in thread
Hi,
I can't get any tablet events (openSUSE 10.3 x86_64, libqt4-4.3.1-23.4 or Qt 4.4
X11 that I built myself). xidump correctly reports X11 events for the wacom
stylus, eraser and cursor (tilt, pressure, rotation, throttle, etc...). However,
all I ever get from Qt are mouse events -- I've tested using the simple program
in the attachment.
Am I missing something? Should I not rely on Qt for tablet events and handle the
raw X11 events the way xidump does instead? I remember tablet events used to
work in Qt3.
Pavel.
// Qt includes:
// Qt includes:
#include <QApplication>
#include <QWidget>
#include <QMouseEvent>
// system includes:
#include <iostream>
// namespace access:
using std::cerr;
using std::endl;
//----------------------------------------------------------------
// WacomEventWidget
//
class WacomEventWidget : public QWidget
{
public:
WacomEventWidget(QWidget * parent = 0, Qt::WindowFlags f = 0):
QWidget(parent, f)
{}
protected:
// virtual:
void tabletEvent(QTabletEvent * event)
{
cerr << "got a tablet event" << endl;
}
void mouseMoveEvent(QMouseEvent * event)
{
cerr << "got a mouse move event" << endl;
event->ignore();
}
};
//----------------------------------------------------------------
// main
//
int
main(int argc, char ** argv)
{
QApplication app(argc, argv);
WacomEventWidget main_window;
main_window.resize(640, 480);
main_window.show();
// start the event loop:
int result = app.exec();
return result;
}
TEMPLATE = app
TEMPLATE = app
LANGUAGE = C++
TARGET = wacom
PROJECTNAME = wacom
CONFIG -= release
CONFIG -= debug
CONFIG += qt gui rtti exceptions opengl warn_on thread console
#CONFIG += debug
CONFIG += release
SOURCES += main.cxx
Message 2 in thread
Pavel Koshevoy wrote:
> Hi,
>
> I can't get any tablet events (openSUSE 10.3 x86_64, libqt4-4.3.1-23.4
> or Qt 4.4 X11 that I built myself). xidump correctly reports X11 events
> for the wacom stylus, eraser and cursor (tilt, pressure, rotation,
> throttle, etc...). However, all I ever get from Qt are mouse events --
> I've tested using the simple program in the attachment.
>
> Am I missing something? Should I not rely on Qt for tablet events and
> handle the raw X11 events the way xidump does instead? I remember tablet
> events used to work in Qt3.
>
> Pavel.
>
In case this is relevant, here is some additional info.
The table works with gimp 2.2.17 that shipped with SUSE 10.3.
Here is an excerpt from xidump -v -l output:
WacomEraser extension
key: min=8, max=39, num=32
btn: num=32
val: axes=6 mode=abs buf=0
axis[0]: res=2540, min=0, max=30480
axis[1]: res=2540, min=0, max=19049
axis[2]: res=1, min=0, max=1023
axis[3]: res=1, min=-64, max=63
axis[4]: res=1, min=-64, max=63
axis[5]: res=1, min=0, max=1023
WacomStylus extension
key: min=8, max=39, num=32
btn: num=32
val: axes=6 mode=abs buf=0
axis[0]: res=2540, min=0, max=30480
axis[1]: res=2540, min=0, max=19049
axis[2]: res=1, min=0, max=1023
axis[3]: res=1, min=-64, max=63
axis[4]: res=1, min=-64, max=63
axis[5]: res=1, min=0, max=1023
WacomCursor extension
key: min=8, max=39, num=32
btn: num=32
val: axes=6 mode=rel buf=0
axis[0]: res=2540, min=0, max=30000
axis[1]: res=2540, min=0, max=24060
axis[2]: res=1, min=0, max=1023
axis[3]: res=1, min=-900, max=899
axis[4]: res=1, min=-1023, max=1023
axis[5]: res=1, min=0, max=1023
xorg.conf excerpts
Section "ServerLayout"
InputDevice "WacomCursor" "SendCoreEvents"
InputDevice "WacomStylus" "SendCoreEvents"
InputDevice "WacomEraser" "SendCoreEvents"
....
EndSection
Section "InputDevice"
Identifier "WacomCursor"
Driver "wacom"
Option "BottomX" "30000"
Option "Device" "/dev/ttyS0"
Option "InputFashion" "Tablet"
Option "Mode" "Relative"
Option "Name" "GRAPHIRE / INTUOS (SERIAL)"
Option "SendCoreEvents" "on"
Option "Type" "cursor"
Option "Speed" "3.0"
Option "Vendor" "WACOM"
EndSection
Section "InputDevice"
Identifier "WacomStylus"
Driver "wacom"
Option "BottomX" "30000"
Option "Device" "/dev/ttyS0"
Option "InputFashion" "Pen"
Option "Mode" "Absolute"
Option "Name" "GRAPHIRE / INTUOS Stylus (SERIAL)"
Option "Protocol" "Auto"
Option "Type" "stylus"
Option "Tilt" "on"
Option "KeepShape" "on"
Option "Vendor" "WACOM"
EndSection
Section "InputDevice"
Identifier "WacomEraser"
Driver "wacom"
Option "BottomX" "30000"
Option "Device" "/dev/ttyS0"
Option "InputFashion" "Eraser"
Option "Mode" "Absolute"
Option "Name" "GRAPHIRE / INTUOS Eraser (SERIAL)"
Option "Protocol" "Auto"
Option "Type" "eraser"
Option "Tilt" "on"
Option "KeepShape" "on"
Option "Vendor" "WACOM"
EndSection
Xorg.0.log excerpt
(**) WacomCursor: always reports core events
(**) WacomCursor device is /dev/ttyS0
(**) WacomCursor is in relative mode
(**) WACOM: suppress value is 2
(**) Option "BottomX" "30000"
(**) WacomCursor: bottom x = 30000
(**) Option "BaudRate" "9600"
(**) WacomCursor: serial speed 9600
(**) Option "Speed" "3.0"
(**) WacomCursor: speed = 3.000
(**) Option "SendCoreEvents"
(**) WacomStylus: always reports core events
(**) WacomStylus device is /dev/ttyS0
(**) WacomStylus is in absolute mode
(**) WACOM: suppress value is 2
(**) Option "Tilt" "on"
(**) Option "KeepShape" "on"
(**) WacomStylus: keeps shape
(**) Option "BottomX" "30000"
(**) WacomStylus: bottom x = 30000
(**) Option "BaudRate" "9600"
(**) WacomStylus: serial speed 9600
(**) Option "SendCoreEvents"
(**) WacomEraser: always reports core events
(**) WacomEraser device is /dev/ttyS0
(**) WacomEraser is in absolute mode
(**) WACOM: suppress value is 2
(**) Option "Tilt" "on"
(**) Option "KeepShape" "on"
(**) WacomEraser: keeps shape
(**) Option "BottomX" "30000"
(**) WacomEraser: bottom x = 30000
(**) Option "BaudRate" "9600"
(**) WacomEraser: serial speed 9600
(II) XINPUT: Adding extended input device "WacomEraser" (type: Wacom Eraser)
(II) XINPUT: Adding extended input device "WacomStylus" (type: Wacom Stylus)
(II) XINPUT: Adding extended input device "WacomCursor" (type: Wacom Cursor)
(II) XINPUT: Adding extended input device "MediaPlay" (type: MOUSE)
(II) XINPUT: Adding extended input device "Keyboard[0]" (type: KEYBOARD)
(**) Option "Device" "/dev/ttyS0"
(**) Option "StopBits" "1"
(**) Option "DataBits" "8"
(**) Option "Parity" "None"
(**) Option "Vmin" "1"
(**) Option "Vtime" "10"
(**) Option "FlowControl" "Xoff"
usbDetect: can not ioctl version
(==) Wacom tablet model : GD-0912-R00,V1.2-7
(==) Wacom using pressure threshold of 61 for button 1
(==) Wacom Serial Intuos tablet speed=9600 maxX=30480 maxY=24060 maxZ=1023
resX=2540 resY=2540 tilt=enabled
(==) Wacom device "WacomCursor" top X=0 top Y=0 bottom X=30000 bottom Y=24060
(==) Wacom device "WacomStylus" top X=0 top Y=0 bottom X=30480 bottom Y=19049
(==) Wacom device "WacomEraser" top X=0 top Y=0 bottom X=30480 bottom Y=19049
--
[ signature omitted ]
Message 3 in thread
I think I found the problem. On line 2054 of qapplication_x11.cpp
(Qt 4.4) there are 3 hard coded device names that Qt expects the wacom devices
to use. The reason my tablet didn't work with Qt is that I named my devices
WacomStylus, WacomEraser and WacomCursor. Qt, apparently expected them to be
named stylus, eraser and pen. This seems wrong to me -- Qt shouldn't expect a
particular naming convention from xorg.conf, it should query the X11 server for
the names of XInputExtension devices dynamically, the way xidump does it.
Anyway, I changed the wacom device identifier in my xorg.conf to "stylus"
"eraser" and "cursor" and I now receive Qt tablet events for the stylus and
eraser, but not for the cursor. Looking at qapplication_x11.cpp it is not
surprising, I don't see the cursor mentioned there at all -- there is a "pen",
but the tablet cursor is not a pen, it's more like a mouse.
This appears to be a long standing bug, it is a wonder it survived all the way
through Qt 4.4. I guess there aren't that many people running Linux with a
graphics tablet or on a tablet PC.
Pavel.
Pavel Koshevoy wrote:
> Pavel Koshevoy wrote:
>> Hi,
>>
>> I can't get any tablet events (openSUSE 10.3 x86_64, libqt4-4.3.1-23.4
>> or Qt 4.4 X11 that I built myself). xidump correctly reports X11
>> events for the wacom stylus, eraser and cursor (tilt, pressure,
>> rotation, throttle, etc...). However, all I ever get from Qt are mouse
>> events -- I've tested using the simple program in the attachment.
>>
>> Am I missing something? Should I not rely on Qt for tablet events and
>> handle the raw X11 events the way xidump does instead? I remember
>> tablet events used to work in Qt3.
>>
>> Pavel.
>>
>
> In case this is relevant, here is some additional info.
> The table works with gimp 2.2.17 that shipped with SUSE 10.3.
>
> Here is an excerpt from xidump -v -l output:
> WacomEraser extension
> key: min=8, max=39, num=32
> btn: num=32
> val: axes=6 mode=abs buf=0
> axis[0]: res=2540, min=0, max=30480
> axis[1]: res=2540, min=0, max=19049
> axis[2]: res=1, min=0, max=1023
> axis[3]: res=1, min=-64, max=63
> axis[4]: res=1, min=-64, max=63
> axis[5]: res=1, min=0, max=1023
>
> WacomStylus extension
> key: min=8, max=39, num=32
> btn: num=32
> val: axes=6 mode=abs buf=0
> axis[0]: res=2540, min=0, max=30480
> axis[1]: res=2540, min=0, max=19049
> axis[2]: res=1, min=0, max=1023
> axis[3]: res=1, min=-64, max=63
> axis[4]: res=1, min=-64, max=63
> axis[5]: res=1, min=0, max=1023
>
> WacomCursor extension
> key: min=8, max=39, num=32
> btn: num=32
> val: axes=6 mode=rel buf=0
> axis[0]: res=2540, min=0, max=30000
> axis[1]: res=2540, min=0, max=24060
> axis[2]: res=1, min=0, max=1023
> axis[3]: res=1, min=-900, max=899
> axis[4]: res=1, min=-1023, max=1023
> axis[5]: res=1, min=0, max=1023
>
>
> xorg.conf excerpts
> Section "ServerLayout"
> InputDevice "WacomCursor" "SendCoreEvents"
> InputDevice "WacomStylus" "SendCoreEvents"
> InputDevice "WacomEraser" "SendCoreEvents"
> ....
> EndSection
>
> Section "InputDevice"
> Identifier "WacomCursor"
> Driver "wacom"
> Option "BottomX" "30000"
> Option "Device" "/dev/ttyS0"
> Option "InputFashion" "Tablet"
> Option "Mode" "Relative"
> Option "Name" "GRAPHIRE / INTUOS (SERIAL)"
> Option "SendCoreEvents" "on"
> Option "Type" "cursor"
> Option "Speed" "3.0"
> Option "Vendor" "WACOM"
> EndSection
>
> Section "InputDevice"
> Identifier "WacomStylus"
> Driver "wacom"
> Option "BottomX" "30000"
> Option "Device" "/dev/ttyS0"
> Option "InputFashion" "Pen"
> Option "Mode" "Absolute"
> Option "Name" "GRAPHIRE / INTUOS Stylus (SERIAL)"
> Option "Protocol" "Auto"
> Option "Type" "stylus"
> Option "Tilt" "on"
> Option "KeepShape" "on"
> Option "Vendor" "WACOM"
> EndSection
>
> Section "InputDevice"
> Identifier "WacomEraser"
> Driver "wacom"
> Option "BottomX" "30000"
> Option "Device" "/dev/ttyS0"
> Option "InputFashion" "Eraser"
> Option "Mode" "Absolute"
> Option "Name" "GRAPHIRE / INTUOS Eraser (SERIAL)"
> Option "Protocol" "Auto"
> Option "Type" "eraser"
> Option "Tilt" "on"
> Option "KeepShape" "on"
> Option "Vendor" "WACOM"
> EndSection
>
> Xorg.0.log excerpt
> (**) WacomCursor: always reports core events
> (**) WacomCursor device is /dev/ttyS0
> (**) WacomCursor is in relative mode
> (**) WACOM: suppress value is 2
> (**) Option "BottomX" "30000"
> (**) WacomCursor: bottom x = 30000
> (**) Option "BaudRate" "9600"
> (**) WacomCursor: serial speed 9600
> (**) Option "Speed" "3.0"
> (**) WacomCursor: speed = 3.000
> (**) Option "SendCoreEvents"
> (**) WacomStylus: always reports core events
> (**) WacomStylus device is /dev/ttyS0
> (**) WacomStylus is in absolute mode
> (**) WACOM: suppress value is 2
> (**) Option "Tilt" "on"
> (**) Option "KeepShape" "on"
> (**) WacomStylus: keeps shape
> (**) Option "BottomX" "30000"
> (**) WacomStylus: bottom x = 30000
> (**) Option "BaudRate" "9600"
> (**) WacomStylus: serial speed 9600
> (**) Option "SendCoreEvents"
> (**) WacomEraser: always reports core events
> (**) WacomEraser device is /dev/ttyS0
> (**) WacomEraser is in absolute mode
> (**) WACOM: suppress value is 2
> (**) Option "Tilt" "on"
> (**) Option "KeepShape" "on"
> (**) WacomEraser: keeps shape
> (**) Option "BottomX" "30000"
> (**) WacomEraser: bottom x = 30000
> (**) Option "BaudRate" "9600"
> (**) WacomEraser: serial speed 9600
> (II) XINPUT: Adding extended input device "WacomEraser" (type: Wacom
> Eraser)
> (II) XINPUT: Adding extended input device "WacomStylus" (type: Wacom
> Stylus)
> (II) XINPUT: Adding extended input device "WacomCursor" (type: Wacom
> Cursor)
> (II) XINPUT: Adding extended input device "MediaPlay" (type: MOUSE)
> (II) XINPUT: Adding extended input device "Keyboard[0]" (type: KEYBOARD)
> (**) Option "Device" "/dev/ttyS0"
> (**) Option "StopBits" "1"
> (**) Option "DataBits" "8"
> (**) Option "Parity" "None"
> (**) Option "Vmin" "1"
> (**) Option "Vtime" "10"
> (**) Option "FlowControl" "Xoff"
> usbDetect: can not ioctl version
> (==) Wacom tablet model : GD-0912-R00,V1.2-7
> (==) Wacom using pressure threshold of 61 for button 1
> (==) Wacom Serial Intuos tablet speed=9600 maxX=30480 maxY=24060
> maxZ=1023 resX=2540 resY=2540 tilt=enabled
> (==) Wacom device "WacomCursor" top X=0 top Y=0 bottom X=30000 bottom
> Y=24060
> (==) Wacom device "WacomStylus" top X=0 top Y=0 bottom X=30480 bottom
> Y=19049
> (==) Wacom device "WacomEraser" top X=0 top Y=0 bottom X=30480 bottom
> Y=19049
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
--
[ signature omitted ]
Message 4 in thread
Hi,
> This appears to be a long standing bug, it is a wonder it survived all
> the way through Qt 4.4. I guess there aren't that many people running
> Linux with a graphics tablet or on a tablet PC.
Most of them probably don't rename tablet devices. I suggest you send a bug
report to Trolltech to have this fixed in an upcoming release:
http://trolltech.com/bugreport-form
--
[ signature omitted ]
Message 5 in thread
Hi everybody,
I am currently testing Qtconcurrent as well as Intel Threading Building
Block to compare them
and see what is more efficient / easy to use for multithreading.
My first issue is when mixing TBB thread with qt classes. It seems that qt
is having a thread context
which doesn't work when the thread is created with another threading system
( other than qt of course ).
So when calling some simple qt functions on an object which thread was not
created by qt, crash
( quite often in qatomic functions ). The related question is then, how
should an external system
create a thread so that qt has the right context ? ( is that possible in
fact ... )
QtConcurrent : simple simple to use, but in fact not really.
- how is the number of cpu / core detected and how can it be changed ? Some
people don't want to use
all cores on a cpu, they want that in settings.
- all samples yet show some simple loops ( on simple types ). Threading is
often used on big part of
a software, never of such simple loop. So the big first issue is to pass at
least an argument to each
thread to use. My approach was to provide the functor a pair ( reference to
a class, value ), so that I
can call on each step a function of my class I want to be called by thread (
the value is what to do ).
Something like that in fact :
struct QtConcurrentWrapper : public std::unary_function< const
std::pair<myclass*, value>, void>
{
void operator()( const std::pair<myclass*, value>& val ) const
{
myClass->domyjob( val );
}
};
It this the way to do parameter passing to qtconcurrent ?
Alexandre
--
[ signature omitted ]
Message 6 in thread
Dimitri wrote:
> Hi,
>
>> This appears to be a long standing bug, it is a wonder it survived all
>> the way through Qt 4.4. I guess there aren't that many people running
>> Linux with a graphics tablet or on a tablet PC.
>
> Most of them probably don't rename tablet devices. I suggest you send a
> bug report to Trolltech to have this fixed in an upcoming release:
> http://trolltech.com/bugreport-form
>
I did send a bug report to trolltech.
It is a poor assumption to expect every Linux distros Xorg config tool to give
the wacom devices hardcoded identifiers. By definition those are user
configurable. The identifiers are just handles (variables), the proper way to
query X for input extended devices is by type (constants) -- that can be
expected to be hardcoded to "stylus", "eraser" or "cursor".
Pavel.
--
[ signature omitted ]