I would like to use the wheelEmulation for a touchscreen. I have setup all the options: Evdev Wheel Emulation (287): 1 Evdev Wheel Emulation Axes (288): 0, 0, 4, 5 Evdev Wheel Emulation Inertia (289): 10 Evdev Wheel Emulation Timeout (290): 200 Evdev Wheel Emulation Button (291): 1 // single touch touchscreen Once activated, whenever I touched the screen even without moving I had the scroll to bottom. So I went to the code of driver : xf86-input-evdev-2.8.0 Here is what I pointed out : /* We don't want to intercept real mouse wheel events */ if(pEv->type == EV_ABS) { int axis = pEvdev->abs_axis_map[pEv->code]; oldValue = valuator_mask_get(pEvdev->vals, axis); xf86IDrvMsg(pInfo, X_WARNING, "oldValue : %d\n",oldValue); valuator_mask_set(pEvdev->vals, axis, value); value -= oldValue; /* make value into a differential measurement */ } the oldValue is in my case always equals to zero, which make then the driver not working properly. the pEvdev vals is reset here evdev.c line 1037: if (pEvdev->vals) valuator_mask_zero(pEvdev->vals); so I commented theses lines. But then I get funny movements. so I put the lines here emuWheels.c line 80 else { ms = pEvdev->emulateWheel.expires - GetTimeInMillis(); if (ms > 0 || wheelDone == 0) { /* * If the button is released early enough emit the button * press/release events */ if (pEvdev->vals) valuator_mask_zero(pEvdev->vals); EvdevQueueButtonClicks(pInfo, button, 1); } } the funny movements were off. So far so good. But now in some cases, when I first touch the touchscreen I get some scroll down movements. So I did modify this (emuWheel.c): if(pEv->type == EV_ABS) { int axis = pEvdev->abs_axis_map[pEv->code]; oldValue = valuator_mask_get(pEvdev->vals, axis); valuator_mask_set(pEvdev->vals, axis, value); if(oldValue==0 || (abs(oldValue-value))>200) { return TRUE; } value -= oldValue; /* make value into a differential measurement */ and this (emuWheel.c): /* if this axis has not been configured, just eat the motion */ if (!axis->up_button) return rc; xf86IDrvMsg(pInfo, X_WARNING, "axis->traveled_distance %d\n",axis->traveled_distance); if (axis->traveled_distance == 0 || (abs(value) < 10) ) { axis->traveled_distance += value; return rc; } axis->traveled_distance += value; then it seems to be ok for me. Except for slow movements that do not make scroll. and that the scroll is not smooth. I did also something else, I wanted to have click on release even after the timeout of enable wheelEmulation. So even if the timeout is there , if there were no scroll activated then the button is clicked. I added a global variable set when there is a scroll, and reset when button is pressed. Kind regards, Laurent.
Created attachment 84762 [details] [review] 0001-Fix-wheel-emulation-for-absolute-device-68415.patch
which info ?
if you can, please test the patch from comment #1
hello, do I have to do the change in my own file, or do you have "ready" file that I can use ?
So I did modified the emuWheels and evdev files. I can only scroll in one direction, to the top.
(In reply to comment #4) > hello, do I have to do the change in my own file, or do you have "ready" > file that I can use ? please apply it to your git tree. judging by Comment #0 I guess you already have one. (In reply to comment #5) > So I did modified the emuWheels and evdev files. > I can only scroll in one direction, to the top. this was on a vanilla checkout? did you revert your previous patches?
(In reply to comment #6) > (In reply to comment #4) > > hello, do I have to do the change in my own file, or do you have "ready" > > file that I can use ? > > please apply it to your git tree. judging by Comment #0 I guess you already > have one. > no, and I must that I have lear something :-) > > > (In reply to comment #5) > > So I did modified the emuWheels and evdev files. > > I can only scroll in one direction, to the top. > > this was on a vanilla checkout? did you revert your previous patches? I did take a clean version of xf86-input-evdev-2.8.1, apply your patches and recompile it.
ok I installed the git tree, trying to checkout the vanilla branches but no help. I took git tree from here : http://anongit.freedesktop.org/git/xorg/driver/xf86-input-evdev.git
from the new source , now I have a more or less correct behaviour. still something annoying. When I press the screen and don't move, is interpreted as wheel movement.
chances are high that when you don't move, there is still some amount of movement happening. Check with evemu-record and have a look at the event data. That's a separate issue we need to address one day, but not directly part of this bug. Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Aug 26 14:56:07 2013 +1000 Fix wheel emulation for absolute device (#68415)
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.