This forum has been archived. All content is frozen. Please use KDE Discuss instead.

KDE-wide jog dial support? (ShuttlePRO and similar devices)

Tags: None
(comma "," separated)
TheDiveO
Registered Member
Posts
595
Karma
3
OS
I'm not exactly sure if this is the right corner of the KDE forum to put my question forward, so if you know better, please direct me to the place where my question may be better suited.

For video editing purposes I've got a jog dial, it's a Contour ShuttlePRO v2 USB device. To my limited understanding, it's a USB HID device. When connected to my Linux system, the kernel will spit out the following two lines of information:
Code: Select all
input: Contour Design ShuttlePRO v2 as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.2/1-1.1.2:1.0/input/input6
hid-generic 0003:0B33:0030.0006: input,hidraw5: USB HID v1.10 Device [Contour Design ShuttlePRO v2] on usb-0000:00:1a.0-1.1.2/input0


At this time, the fine Kdenlive video editor directly supports this device. However, I cannot use the device in other applications, such as The Gimp, the KDE graphics applications, et ceteral. The company making the ShuttlePRO is Contour and it has software for Windows and OS X which allows the ShuttlePRO to be used in basically all Windows or OS X applications.

I've locked around but could not find anything suitable for KDE nor in the KDE SC, not even a macro recorder or something similar. However, if I simply missed the obvious I would be glad if other people could point me to the appropriate tools.

So, in case there is nothing suitable in the KDE SC, where can I get more information about how to maybe program some kind of KDE tool that reads events from the ShuttlePRO and simulates keyboard and mouse events? In addition, how can I find out in a KDE tool which application currently is active. The latter becomes necessary as I need to switch between different event mappings depending on which application currently hold the focus.

Any concrete help is greatly appreciated!
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Can you try running "xev" to see if it makes any output which is detectable by it?
You might also want to look into https://wiki.archlinux.org/index.php/jo ... ving_mouse


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
TheDiveO
Registered Member
Posts
595
Karma
3
OS
I already gave xev a try, but it doesn't respond any events from the device. However, I stumbled across evtest which I could use successfully to dump the events sent by the ShuttlePRO. So what I would like to have is a KDE tool that can attach to a Linux input device and map events to X events.

Is there a Qt od KDE abstraction for working with emulated keyboard and core pointer events? I would like to not get down to xlib level, but instead make use of any abstraction available.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
I'm not aware of any such abstraction layer, at the very least it isn't something exported outside of Qt.
What sort of events did your ShuttlePRO generate?


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
TheDiveO
Registered Member
Posts
595
Karma
3
OS
It is probably the best to let the ShuttlePro v2 speak for itself... ;)
Code: Select all
$ evtest /dev/input/by-id/usb-Contour_Design_ShuttlePRO_v2-event-if00
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0xb33 product 0x30 version 0x110
Input device name: "Contour Design ShuttlePRO v2"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 256 (BTN_0)
    Event code 257 (BTN_1)
    Event code 258 (BTN_2)
    Event code 259 (BTN_3)
    Event code 260 (BTN_4)
    Event code 261 (BTN_5)
    Event code 262 (BTN_6)
    Event code 263 (BTN_7)
    Event code 264 (BTN_8)
    Event code 265 (BTN_9)
    Event code 266 (?)
    Event code 267 (?)
    Event code 268 (?)
    Event code 269 (?)
    Event code 270 (?)
  Event type 2 (EV_REL)
    Event code 7 (REL_DIAL)
    Event code 8 (REL_WHEEL)
  Event type 4 (EV_MSC)
    Event code 4 (MSC_SCAN)
Properties:
Testing ... (interrupt to exit)
Event: time 1391533198.557309, type 2 (EV_REL), code 8 (REL_WHEEL), value 1
Event: time 1391533198.557309, -------------- SYN_REPORT ------------
Event: time 1391533200.109299, type 2 (EV_REL), code 8 (REL_WHEEL), value 1
Event: time 1391533200.109299, -------------- SYN_REPORT ------------
Event: time 1391533201.421290, type 2 (EV_REL), code 8 (REL_WHEEL), value 1
Event: time 1391533201.421290, -------------- SYN_REPORT ------------
Event: time 1391533206.021259, type 2 (EV_REL), code 8 (REL_WHEEL), value 1
Event: time 1391533206.021259, -------------- SYN_REPORT ------------
Event: time 1391533207.021251, type 2 (EV_REL), code 8 (REL_WHEEL), value 2
Event: time 1391533207.021251, -------------- SYN_REPORT ------------
Event: time 1391533207.749247, type 2 (EV_REL), code 8 (REL_WHEEL), value 1
Event: time 1391533207.749247, -------------- SYN_REPORT ------------
Event: time 1391533211.445222, type 2 (EV_REL), code 7 (REL_DIAL), value 1
Event: time 1391533211.445222, -------------- SYN_REPORT ------------
Event: time 1391533211.829218, type 2 (EV_REL), code 7 (REL_DIAL), value 2
Event: time 1391533211.829218, -------------- SYN_REPORT ------------
Event: time 1391533212.149221, type 2 (EV_REL), code 7 (REL_DIAL), value 3
Event: time 1391533212.149221, -------------- SYN_REPORT ------------
Event: time 1391533212.437216, type 2 (EV_REL), code 7 (REL_DIAL), value 4
Event: time 1391533212.437216, -------------- SYN_REPORT ------------
Event: time 1391533212.757213, type 2 (EV_REL), code 7 (REL_DIAL), value 5
Event: time 1391533212.757213, -------------- SYN_REPORT ------------
Event: time 1391533212.997213, type 2 (EV_REL), code 7 (REL_DIAL), value 6
Event: time 1391533212.997213, -------------- SYN_REPORT ------------
Event: time 1391533214.653202, type 2 (EV_REL), code 7 (REL_DIAL), value 6
Event: time 1391533214.653202, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90001
Event: time 1391533214.653202, type 1 (EV_KEY), code 256 (BTN_0), value 1
Event: time 1391533214.653202, -------------- SYN_REPORT ------------
Event: time 1391533214.765144, type 2 (EV_REL), code 7 (REL_DIAL), value 6
Event: time 1391533214.765144, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90001
Event: time 1391533214.765144, type 1 (EV_KEY), code 256 (BTN_0), value 0
Event: time 1391533214.765144, -------------- SYN_REPORT ------------


The ShuttlePRO v2 can generate the following events:
  • button events
  • shuttle events -- this is the a black ring around the jog. The shuttle is spring-loaded and returns to its center position when letting it loose. It produces (absolute) position values from -7 to +7.
  • jog events -- this is the endless jog dial in the center. It produces increasing or decreasing absolute position values in the range 0..255.

One thing I noticed and that may point at some minor issue is that the ShuttlePRO reports both the shuttle d the jog as sending relative events. This is, in my opinion, a mistake by Contour: if you look at the events you see that the jog and shuttle events contain absolute positions. The unfortunate result of this mistake seems to be that the Linux USBHID driver swallows relative jog and shuttle events with the position of 0, as it correctly thinks that this would be "no movement" when in fact it indicates movement to the absolute position 0.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
How did the Contour software allow other applications to be used by the ShuttlePRO? Did it simply move the mouse cursor, or did it do something else?


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
TheDiveO
Registered Member
Posts
595
Karma
3
OS
There is no Contour software for Linux, only for Windows and Mac OSX. On Windows, the Contour software works on the basis of the program (file idenity) that creates a window. It thus does not on the title of a window but instead uses the name of the executable. According to the manual describing the software, when updating software for which key and shuttle bindings exist, the user can update the reference between the executable and the set of bindings.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
I see, this seems rather specific and special. Due to this, any particular support for jog-dials would need to be implemented in Qt first, so that KDE applications could then utilise it. Otherwise, you could look into options which allow you to map the functions of a Joystick to allow them to function similar to a mouse - which X11 does support I believe.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
TheDiveO
Registered Member
Posts
595
Karma
3
OS
I don't think that Qt support is required. I can perfectly live with a KDE daemon that handles the /dev/input device pseudo file, reading events and then sending the appropriate synthetized keyboard and mouse events to KDE applications. Where can I find more about KDE daemons?
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Due to the nature of such a process, it would probably would be better suited to being it's own independent application.
I would recommend checking the QCoreApplication, KApplication and KUniqueApplication documentation on api.kde.org and doc.qt-project.org.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]


Bookmarks



Who is online

Registered users: abc72656, Bing [Bot], daret, Google [Bot], lockheed, Sogou [Bot], Yahoo [Bot]