14

I've got a wacom pen with a button. How can I trigger scrolling when moving the pen with the button pressed?

According to xev, below, the triggering events are MotionNotify with state 0x200.

If this isn't done trivially, an idea I have is to build a service to read these events from somewhere and transform them into other events. This way, I can define gestures, as well. With this approach:

  • Where can I read them?
  • How can I write events back?
  • Are there libraries to detect gestures?
MotionNotify event, serial 33, synthetic NO, window 0xc00001,
    root 0x2ce, subw 0x0, time 695630659, (349,181), root:(1255,185),
    state 0x0, is_hint 0, same_screen YES

ButtonPress event, serial 33, synthetic NO, window 0xc00001,
    root 0x2ce, subw 0x0, time 695630659, (349,181), root:(1255,185),
    state 0x0, button 2, same_screen YES

MotionNotify event, serial 33, synthetic NO, window 0xc00001,
    root 0x2ce, subw 0x0, time 695630667, (348,183), root:(1254,187),
    state 0x200, is_hint 0, same_screen YES

MotionNotify event, serial 33, synthetic NO, window 0xc00001,
    root 0x2ce, subw 0x0, time 695630675, (347,184), root:(1253,188),
    state 0x200, is_hint 0, same_screen YES

...

MotionNotify event, serial 33, synthetic NO, window 0xc00001,
    root 0x2ce, subw 0x0, time 695632069, (327,486), root:(1233,490),
    state 0x200, is_hint 0, same_screen YES

ButtonRelease event, serial 33, synthetic NO, window 0xc00001,
    root 0x2ce, subw 0x0, time 695632069, (327,486), root:(1233,490),
    state 0x200, button 2, same_screen YES

  • Just wanted to ask the same question. Any ideas? – student Jun 18 '16 at 15:42
  • What exactly are you trying to accomplish? If it's just for a certain app, it might be easier to configure it that way. For example, the GIMP will let you scroll an image if you hold down the middle button. In Firefox, I've used the "Grab and Drag" extension to make it work similarly. – hackerb9 Dec 28 '17 at 19:20
0

I ran into a much simpler variant of this problem: translating the extra keys on my mouse into keyboard/mouse-button combinations, to allow binding them in the window manager to move/resize windows. Perhaps my code can serve you as a starting point:

https://gist.github.com/CyberShadow/ae30a8d9f86c170c2451c3dd7edb649c

The gist of the idea is that it captures input events from my mouse's /dev/input/... device, optionally modifies them, and writes them back out to /dev/uinput.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.