Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: multi touch gestures on T530

  1. #1
    Join Date
    Jan 2013
    Beans
    17

    Question multi touch gestures on T530

    Hi,

    I recently bought a lenovo thinkpad T530 and installed ubuntu 12.10. Wanted to know if I can get touch gestures to work on my touchpad like 3 fingers swipe etc for changing tracks in music etc. I got the 2 finger scroll to work without a problem. Is the number of gestures a hardware limitation or a software one ? Any help is appreciated. googling leads me to no-where.

    Thanks.

  2. #2
    Join Date
    Feb 2010
    Beans
    24

    Re: multi touch gestures on T530

    Hello curiousgally,

    I recently got the three finger swipe to work, after a loooooonnngg time googling. You can see if touchegg works for you:
    http://code.google.com/p/touchegg/
    It enables a lot of configuration of your synaptics touchpad. For me however it was a dead end. My solution is a little derivative hack from
    http://rickey-nctu.blogspot.co.uk/20...erlubuntu.html

    First and foremost, you should check if your hardware detects three fingers.

    Get your copy the synaptics configuration file and copy it to the following location:
    Code:
    sudo cp /usr/share/X11/xorg.conf.d/50-synaptics.conf /etc/X11/xorg.conf
    Modify the file you have just copied
    Code:
    sudo gedit /etc/X11/xorg.conf
    Find the section enclosed by 'Section "InputClass"' 'EndSection' that contains 'Identifier "touchpad catchall"'

    And add the lines 'Option "SHMConfig" "on"' and 'Option "Protocol" "event"' for it to look something like this:
    Code:
    Section "InputClass"
       Identifier "touchpad catchall"
       MatchIsTouchpad "on"
       MatchDevicePath "/dev/input/event*"
       Driver "synaptics"
       Option "SHMConfig" "on"
       Option "Protocol" "event"
    EndSection
    Then you have to restart X, or just restart you laptop. After that type in the terminal
    Code:
    synclient -m 100
    And move your cursor around. There should be a column named "f" and it should return the number of fingers that you are being detected. If that number includes 3 when you press with three finger your touchpad supports three finger swipe. Congrats!

    Right; now download the file attached and save it where you want. And to test it:

    Code:
    python /path/to/file
    Try the three finger swipe. I have configured it so to change workspace.

    If that works for you and you configured it to your needs, just add it to your start up applications with the command
    Code:
    bash -c "python /path/to/file"
    Basically the file monitors the synclient and detects when three fingers have been activated and returns an appropriate action. You can set the actions yourself and the sensitivity of the swipe movements.

    Hope this helps
    Attached Files Attached Files
    Last edited by Melclic; June 20th, 2013 at 11:34 AM.

  3. #3
    Join Date
    Nov 2011
    Beans
    2

    Re: multi touch gestures on T530

    hi thanks for this tutorial... i found my hardware detecting up to 3 fingers... however, upon testing the downloaded script, an error is appearing:

    sh: 1: xdotool: not found

    how do i fix this? i also want to be able to shift workspaces using 3-finger swipe as i think it's cool...

  4. #4
    Join Date
    Feb 2010
    Beans
    24

    Re: multi touch gestures on T530

    All you need to do is:
    Code:
    sudo apt-get install xdotool
    Remember that the sensibility of the toucpad is different on each laptop, so set your own sensibility by playing with the numbers in the script. For example the line:
    Code:
    if diff_y > 800:
    I would increase and decrease this value and see what works for you.

  5. #5
    Join Date
    Apr 2011
    Beans
    16

    Re: multi touch gestures on T530

    Thanks so much! Works perfectly!

  6. #6
    Join Date
    Feb 2010
    Beans
    24

    Re: multi touch gestures on T530

    here is the pastebin of it http://pastebin.com/taUP6ei1/
    Last edited by Melclic; May 4th, 2013 at 02:22 PM.

  7. #7
    Join Date
    May 2013
    Beans
    2

    Re: multi touch gestures on T530

    Hello! i tried this suggestion for multitouch and so far it's working perfectly. However i would like to be able to both bind 3 finger and 4 finger gestures ( i noticed my touchpad supports this, so why not use it ).
    I tried the following but it isn't functioning the way i expect. (i just send simple keystrokes for debugging purposes in terminal)

    Code:
    import os
    import re
    import subprocess
    
    if __name__ == "__main__":
        cmd = 'synclient -m 100'
    
        p = subprocess.Popen(cmd, stdout = subprocess.PIPE, stderr = subprocess.STDOUT, shell = True)
        skip = False
        first = True
        start = False
        start_x = 0
        start_y = 0
        diff_x = 0
        diff_y = 0    
        try:
            while True:
                line = p.stdout.readline()
                if not line:
                    break
                try:
                    tokens = [x for x in re.split('([^0-9\.])+', line.strip()) if x.strip()]
                    x, y, fingers = int(tokens[1]), int(tokens[2]), int(tokens[4])
                if fingers==3:
                if not start:
                    start_x = x
                    start_y = y
                    start = True
            if start and not fingers==3:
                diff_x = x-start_x
                diff_y = y-start_y
                #MODIFY THE NUMBERS BELLOW FOR SENSITIVITY
                            #if diff_y > 300:
                            #        os.system("xdotool key ctrl+Left")
                            #elif diff_y < -300:
                            #        os.system("xdotool key ctrl+Right")
                if diff_x > 100:
                                    os.system("xdotool key a")
                            elif diff_x < -100:
                                    os.system("xdotool key b")
                start = False
                start_x = 0
                start_y = 0
                diff_y = 0
                diff_x = 0
            if fingers == 4:
                if not start:
                    start_x = x
                    start_y = y
                    start = True
            if start and not fingers == 4:
                diff_x = x-start_x
                diff_y = y-start_y
                if diff_x > 100:
                    os.system("xdotool key c")
                elif diff_x < -100:
                    os.system("xdotool key d")
                start = False
                start_x = 0
                start_y = 0
                diff_y = 0
                diff_x = 0
                except (IndexError, ValueError):
                    pass
        except KeyboardInterrupt:
            pass

    Using this script , 3 finger swipes give no output and 4 finger swipes give unlogical data to me.

    Another think that i would like to achieve is to be able to bind 3 finger swipe to back and forward. I can for example bind this to alt+Right and alt+Left and have the same shortcut in firefox, however then this will not work in my file explorer. Is it possible to send a back and forward command like the side buttons of a mouse does for example?
    Last edited by mic585; May 3rd, 2013 at 04:46 PM.

  8. #8
    Join Date
    Feb 2010
    Beans
    24

    Re: multi touch gestures on T530

    ok the firs thing i would do is monitor the synclient to reproduce the four finger swipe as best as possible. Take care to note the sensibility between the x and y axis

    Code:
    synclient -m 100
    I took the liberty of changing the script above. I think the problem was the gestures conflicting with each other. However I cannot test it since my touchpad does not support 4 fingers.

    http://pastebin.com/TFHLnVdr

    But let me know if that works for you. Basically I have separated completely the two gestures; where one cannot work while the other is being monitored

    As for the application specific gestures I will need to look into that...

    If anyone reads this and has any suggestions I would love to hear about them.
    Last edited by Melclic; May 4th, 2013 at 07:36 PM.

  9. #9
    Join Date
    May 2013
    Beans
    1

    Re: multi touch gestures on T530

    It's great! But I want to use 3 finger as back button on my browse and nautilus.. How can I configure it?

  10. #10
    Join Date
    May 2013
    Beans
    2

    Re: multi touch gestures on T530

    Quote Originally Posted by Melclic View Post
    ok the firs thing i would do is monitor the synclient to reproduce the four finger swipe as best as possible. Take care to note the sensibility between the x and y axis

    Code:
    synclient -m 100
    I took the liberty of changing the script above. I think the problem was the gestures conflicting with each other. However I cannot test it since my touchpad does not support 4 fingers.

    http://pastebin.com/TFHLnVdr

    But let me know if that works for you. Basically I have separated completely the two gestures; where one cannot work while the other is being monitored

    As for the application specific gestures I will need to look into that...

    If anyone reads this and has any suggestions I would love to hear about them.
    Would it be possible to include the code in your post? The pastebin link is not working for me.

    EDIT : It seems pastebin is not working on the nework i'm currently on (School). I'll try again when i get back home.
    Last edited by mic585; May 8th, 2013 at 07:20 AM.

Page 1 of 2 12 LastLast

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
  •