Results 1 to 3 of 3

Thread: tablet events broken in X

  1. #1
    Join Date
    Apr 2009
    Posts
    10
    Qt products
    Platforms
    Unix/X11

    Default tablet events broken in X

    Hi,

    just upgraded my kubuntu distribution to 9.04 and the app I'm writting no longer receives tablet events .

    Seems X.org is undergoing a transition to hot-pluggable HAL controlled input devices and away from the static configuration in xorg.conf. This means tablet devices may no longer be called "stylus", "eraser" etc but some arbitrary name. This can be configured in the likes of gimp but for QT (from the 4.5 docs):

    Notes for X11 Users

    Qt uses the following hard-coded names to identify tablet devices from the xorg.conf file on X11 (apart from IRIX): 'stylus', 'pen', and 'eraser'. If the devices have other names, they will not be picked up Qt.
    and so dies tablet support...

    Anyone know any workarounds?

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: tablet events broken in X

    Your options seem to be either:
    • Disable the HAL support in your XOrg server
    • Configure HAL to give you what Qt is expecting


    If you don't want to use HAL, you can either build xorg-server without support or you can turn AutoAddDevices option off in the ServerFlags section of your xorg.conf.
    Qt Code:
    1. Option "AutoAddDevices" "false"
    To copy to clipboard, switch view to plain text mode 

    Hal is configured with *.fdi files. The links below might help a little with the second option:
    http://forums.gentoo.org/viewtopic-t...rg+tablet.html
    http://www.gentoo.org/proj/en/deskto...rade-guide.xml

    I cannot really help beyond this.

  3. #3
    Join Date
    Apr 2009
    Posts
    10
    Qt products
    Platforms
    Unix/X11

    Default Re: tablet events broken in X

    ok, I configured HAL to give what QT is expecting...

    Here's how I did it (no warranty implied :

    use lshal to find out what the wacom devices are know by (pipe to less with "lshal | less" and search for wacom). Look for the info.product key. In my case they were "PnP Device (FUJ02e5)" for the stylus and "PnP Device (FUJ02e5) eraser" for the eraser. Take note of the info.udi key or something else that uniquely identifies the entry. My info.uid values were:

    "/org/freedesktop/Hal/devices/pnp_FUJ02e5_serial_platform_0" and
    "/org/freedesktop/Hal/devices/pnp_FUJ02e5_serial_platform_0_subdev"

    now you want to rewrite the info.product key to say "stylus" and "eraser" since this is what QT picks up on ... so create an fdi file in /etc/hal/fdi/policy/ with the following edited for your values:

    Qt Code:
    1. <?xml version="1.0" encoding="ISO-8859-1"?>
    2. <deviceinfo version="0.2">
    3. <device>
    4.  
    5. <match key="info.udi" string="/org/freedesktop/Hal/devices/pnp_FUJ02e5_serial_platform_0">
    6. <merge key="info.product" type="string">stylus</merge>
    7. </match>
    8.  
    9. <match key="info.udi" string="/org/freedesktop/Hal/devices/pnp_FUJ02e5_serial_platform_0_subdev">
    10. <merge key="info.product" type="string">eraser</merge>
    11. </match>
    12.  
    13. </device>
    14. </deviceinfo>
    To copy to clipboard, switch view to plain text mode 

    what it does, is match the entry based on info.udi, and replace the info.product value.

    now restart HAL with /etc/init.d/hal restart, check that everything worked with lshal and if it did restart X, and you should be good to go.

    phew. It's not exactly what you want an end user of your app to go through, even if they do run linux

Similar Threads

  1. QGraphicsView Mouse Events
    By tomf in forum Qt Programming
    Replies: 5
    Last Post: 29th July 2008, 15:03
  2. Qt4.4 on Windows XP Tablet PC edition
    By proto in forum Qt Programming
    Replies: 3
    Last Post: 9th July 2008, 07:30
  3. Replies: 9
    Last Post: 22nd June 2008, 22:26
  4. How to suppress user defined events in processEvents()
    By Artschi in forum Qt Programming
    Replies: 5
    Last Post: 5th July 2007, 10:17
  5. QStackerWidget and mouse events
    By high_flyer in forum Qt Programming
    Replies: 3
    Last Post: 25th April 2006, 19:25

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.