lorenzodelarocha / touchegg

Automatically exported from code.google.com/p/touchegg
0 stars 0 forks source link

DRAG_N_DROP and SCROLL too fast. No delay after DRAG_N_DROP #173

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
José, good morning!

If I disable 2 fingers and 3 fingers options in synaptics, I can configure 
gestures in touchegg with this fingers. For this I run this commands after 
login:
synclient TapButton2=0
synclient TapButton3=0
synclient ClickFinger2=0
synclient ClickFinger3=0
synclient HorizTwoFingerScroll=0
synclient VertTwoFingerScroll=0

I have 3 severe issues in touchegg

1) I tried to configure two finger scroll with DRAG gesture and SCROLL action, 
but on any value for SPEED, scrolling is VERY FAST! I reach bottom of page with 
a little movement of my finger. INVERTED parameter works as expected.

2) I also tried to configure three finger drag n drop, with DRAG gesture 
(TAP_AND_HOLD gesture doesn't worked for me), and DRAG_AND_DROP action. Again, 
dragging is VERY FAST too! The DRAG_AND_DROP action lacks a SPEED option too...

3) Another issue is a need for an option "DELAY" in DRAG_AND_DROP action, where 
the item dragged will wait a time interval to be released, how in MacOSX when 
you are dragging any item or selecting text with 3-finger gesture, when you 
release your fingers, system wait around 500ms to release item dragged. Into 
this time, you can continue dragging or selecting item (easier to drag a file 
from, for example a bottom right corner position in screen to top left 
position... it's impossible in one finger stroke over the trackpad)

My trackpad is from Apple, Macbook Air 5,1 (early 2012)

Is there any parameter hardcoded in touchegg for adjust speeds and solve issues 
1st and 2nd, that I can slow the trackpad only in dragging operations? 
Recompile code is not a problem for me. If possible. I can generate a patch 
after solve this.

I can help to implement 3rd issue. I'm not exactly specialist in C++ and Qt 
(I'm very good with GTK and C), but I can help, if code is well documented...

I'm brazilian too, so we can speak in Portuguese too, if you prefer.

Regards,
Vinícius de Ávila Jorge

Original issue reported on code.google.com by vinicius...@gmail.com on 5 Oct 2012 at 12:11

GoogleCodeExporter commented 8 years ago
Hi Vinícius,

1 and 2) You can find the implementation of the actions in 
src/touchegg/actions/implementation, you can try to adjust the speed easily 
adjusting the lines 52 and 53:
http://code.google.com/p/touchegg/source/browse/touchegg/src/touchegg/actions/im
plementation/Scroll.cpp
The speed of the scrolls changes in every Ubuntu versions and is difficult to 
find a good value

3) Check executeFinish method in:
http://code.google.com/p/touchegg/source/browse/touchegg/src/touchegg/actions/im
plementation/DragAndDrop.cpp
It's very easy to add a QTimer in this method and perform the 
"XTestFakeButtonEvent(QX11Info::display(), this->button, false, 0);" line on 
the timer fire

Greetings

PS - I'm from spain, not brazil ;)

Original comment by jose.exposito89@gmail.com on 5 Oct 2012 at 1:48

GoogleCodeExporter commented 8 years ago
All the code is documented with doxygen, check this file:
http://code.google.com/p/touchegg/source/browse/touchegg/HACKING

Original comment by jose.exposito89@gmail.com on 5 Oct 2012 at 1:49

GoogleCodeExporter commented 8 years ago
Oh I tought you were brazilian... Sorry! I will try these solutions and post 
here the results...

If scroll speed changes, is it possible soft code this parameter, in 
touchegg.conf?

Original comment by vinicius...@gmail.com on 5 Oct 2012 at 2:18

GoogleCodeExporter commented 8 years ago
Yes, you can select speed between 1 and 10, and adjust this params in code

Original comment by jose.exposito89@gmail.com on 5 Oct 2012 at 2:19

GoogleCodeExporter commented 8 years ago
Issues 2 and 3 solved:

in 
http://code.google.com/p/touchegg/source/browse/touchegg/src/touchegg/actions/im
plementation/Scroll.cpp
I changed lines 52 and 53 from
            this->verticalSpeed   = 40 - 2 * configSpeed;
            this->horizontalSpeed = 40 - 2 * configSpeed;
to
            this->verticalSpeed   = 1000 - 100 * configSpeed;
            this->horizontalSpeed = 1000 - 100 * configSpeed;

In 
http://code.google.com/p/touchegg/source/browse/touchegg/src/touchegg/actions/im
plementation/DragAndDrop.cpp
I changed line 61 from
 QCursor::setPos(QCursor::pos().x() + attrs.value(GEIS_GESTURE_ATTRIBUTE_DELTA_X).toFloat(),
            QCursor::pos().y() + attrs.value(GEIS_GESTURE_ATTRIBUTE_DELTA_Y).toFloat());
to
QCursor::setPos(QCursor::pos().x() + 
(attrs.value(GEIS_GESTURE_ATTRIBUTE_DELTA_X).toFloat())/10.0,
            QCursor::pos().y() + (attrs.value(GEIS_GESTURE_ATTRIBUTE_DELTA_Y).toFloat())/10.0);

I'm thinking how to solve 3rd issue... and I have another thing: is it possible 
implementate inertial scrolling?

Original comment by vinicius...@gmail.com on 5 Oct 2012 at 5:15

GoogleCodeExporter commented 8 years ago
Issue 1 and 2 solved (correcting =S )

Original comment by vinicius...@gmail.com on 5 Oct 2012 at 5:45

GoogleCodeExporter commented 8 years ago
Thanks, I'll try this features in Quantal and I'll add then, thanks!!

Original comment by jose.exposito89@gmail.com on 7 Oct 2012 at 9:38

GoogleCodeExporter commented 8 years ago
After some testing in 12.10 looks like the default mouse speed is ok

Original comment by jose.exposito89@gmail.com on 21 Oct 2012 at 8:05

GoogleCodeExporter commented 8 years ago
Hello Jose,

Sorry for posting in an old issue, but as the behaviour I want to replicate is 
explained here I thought it would be a good place to post this.

I am trying to tweak the DragAndDrop.cpp file in order to add a delay as the OP 
explained as 3er issue.

I tried to follow your tip about adding a QTimer in the executeFinish method 
like so:

QTimer::singleShot(500,this,SLOT(XTestFakeButtonEvent(QX11Info::display(), 
this->button, false, 0)));

But I get the following error when compiling:

g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_XML_LIB 
-DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 
-I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtXml 
-I/usr/include/qt4 -I. -o DragAndDrop.o 
src/touchegg/actions/implementation/DragAndDrop.cpp
src/touchegg/actions/implementation/DragAndDrop.cpp: In member function 
‘virtual void DragAndDrop::executeFinish(const QHash<QString, QVariant>&)’:
src/touchegg/actions/implementation/DragAndDrop.cpp:67:104: error: no matching 
function for call to ‘QTimer::singleShot(int, DragAndDrop* const, const char 
[67])’
     QTimer::singleShot(500,this,SLOT(XTestFakeButtonEvent(QX11Info::display(), this->button, false, 0)));
                                                                                                        ^
src/touchegg/actions/implementation/DragAndDrop.cpp:67:104: note: candidate is:
In file included from /usr/include/qt4/QtCore/QtCore:78:0,
                 from ./src/touchegg/util/Include.h:24,
                 from src/touchegg/actions/implementation/DragAndDrop.h:24,
                 from src/touchegg/actions/implementation/DragAndDrop.cpp:21:
/usr/include/qt4/QtCore/qtimer.h:78:17: note: static void 
QTimer::singleShot(int, QObject*, const char*)
     static void singleShot(int msec, QObject *receiver, const char *member);
                 ^
/usr/include/qt4/QtCore/qtimer.h:78:17: note:   no known conversion for 
argument 2 from ‘DragAndDrop* const’ to ‘QObject*’
make: *** [DragAndDrop.o] Error 1

Please note that I obviously have no clue about using Qt and just gave it a 
shot based on a few examples I found.

Could you please post how that line should be modified in order to make it work?

Thank you in advance and congrats for this great piece of software :)

Original comment by antoniog...@gmail.com on 1 Mar 2015 at 12:45