├── elantech-clickpad-fix.desktop ├── install.sh ├── elantech-clickpad-fix.sh └── README.markdown /elantech-clickpad-fix.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=Elantech Clickpad Fix 3 | Comment=Clickpad behaviour fixing 4 | Icon=clickpad 5 | Exec=elantech-clickpad-fix.sh 6 | Terminal=false 7 | Type=Application 8 | NoDisplay=False 9 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # useful vars 4 | fixpath="$( cd "$( dirname "$0" )" && pwd )" 5 | fixname="elantech-clickpad-fix" 6 | bashfix="$fixpath/$fixname.sh" 7 | deskfix="$fixpath/$fixname.desktop" 8 | 9 | # installation 10 | sudo cp "$bashfix" "/usr/bin/" 11 | sudo chmod +x "$bashfix" 12 | sudo cp "$deskfix" "/etc/xdg/autostart/" -------------------------------------------------------------------------------- /elantech-clickpad-fix.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | device=`xinput list "ETPS/2 Elantech Touchpad" | grep -o 'id=[0-9]\+' | egrep "[0-9]{1,}" -o` 4 | 5 | i=0 6 | while read label min delim max; do 7 | if [ $i -eq 0 ]; then 8 | minx=$min 9 | maxx=$max 10 | elif [ $i -eq 1 ]; then 11 | miny=$min 12 | maxy=$max 13 | break 14 | fi 15 | 16 | (( i++ )) 17 | done < <(xinput list "$device" | grep Range) 18 | 19 | middleleft=`echo \($maxx - $minx\) / 2 \* 90 / 100 + $minx | bc -l` 20 | middleright=`echo \($maxx - $minx\) / 2 \* 110 / 100 + $minx | bc -l` 21 | left=`echo $middleright + 1 | bc -l` 22 | right=$maxx 23 | height=`echo \($maxy - $miny\) | bc -l` 24 | top=`echo $height \* 0.82 + $miny | bc -l` 25 | bottom=`echo $height \* 2 + $miny | bc -l` 26 | 27 | # enable the clickpad 28 | xinput set-prop "$device" "Synaptics ClickPad" 1 29 | 30 | # enable right and middle click (drag & drop selection) for the clickpad 31 | xinput set-prop "$device" "Synaptics Soft Button Areas" $left $right $top $bottom $middleleft $middleright $top $bottom 32 | -------------------------------------------------------------------------------- /README.markdown: -------------------------------------------------------------------------------- 1 | ETPS/2 Elantech Clickpad Fix [![Analytics](https://ga-beacon.appspot.com/UA-49657176-1/elantech-clickpad-fix)](https://github.com/igrigorik/ga-beacon) 2 | ============================== 3 | 4 | It enables the ETPS/2 Elantech Clickpad on Ubuntu 12.04 and fixes the behaviour of right and middle soft buttons areas. 5 | 6 | Bugs fixed 7 | ---------- 8 | * Device recognized as touchpad rather than clickpad 9 | * No right click 10 | * No middle click 11 | * No drag selection (and drag & drop) 12 | 13 | Install 14 | ------- 15 | First thing: download this script. 16 | 17 | Now we can proceed to the installation of the fix. 18 | 19 | Assuming that you've downloaded this repository in the `Download` folder, open a terminal and digit: 20 | 21 | `sudo chmod +x ~/Download/elantech-clickpad-fix/install.sh` 22 | 23 | `cd ~/Download/elantech-clickpad-fix/` 24 | 25 | Now we can install the fix: 26 | 27 | `./install` 28 | 29 | Alternatively, you can give execution permissions to `install.sh` right clicking it. So you can execute it simply double clicking it and selecting the execution option. 30 | 31 | Reboot the system. 32 | 33 | Notes 34 | ----- 35 | The two-finger right-click will continue to work. 36 | 37 | Once the installation has been done you can delete the downloaded folder. 38 | 39 | Limits / Future work 40 | -------------------- 41 | This script works only with ETPS/2 Elantech Clickpad, to make it works with other clickpad devices you have to substitute the value of the `devicename` variable in the script with the exact name of your device. To find out the exact name of the device you have to execute in the terminal the xinput command. 42 | 43 | Greetings 44 | ---------- 45 | This script is based on those published by [The Orange Notebook](http://www.theorangenotebook.com/2012/02/call-for-testing-clickpad.html) blog. Thank you! 46 | --------------------------------------------------------------------------------