this answer is just an extension of the answer by @ubuntovative is here
simply to get trackpad accessed as mouse we need to use this command
sudo modprobe -r psmouse && sudo modprobe psmouse proto=imps
This command will basically unload the psmouse
kernel module and load it with an extra parameter proto=imps
, which will make the kernel to treat the touchpad as mouse.
Make command permanent
There are various ways for it, the one that is used in general is to create a .conf file(any name can be used such as psmouse.conf, just .conf is required as file-extension) in /etc/modeprobe.d/
directory with the command options psmouse proto=imps
, which will basically load the kernel module psmouse with parameter proto=imps at first place.
The problem with these approaches is they are not working all the time, for me it is not working in debian 12 based distro.
The approach that always work for me
For me using cron jobs works all the time, which will run this command at every boot, for this do the following:
- create a file /etc/crontab if not already created,
- Then add this line at end of this file
@reboot root modprobe -r psmouse && modprobe psmouse proto=imps
Issue with the command
As mentioned in the above answers, using trackpad as mouse will result in loss of some of its features, for me the scrolling is not available anymore.
Workaround to get scrolling back
To get scrolling back i am using "button" scrolling method in libinput driver, what this will do is when you press the set button(the one we would set among the two trackpad buttons to be recognized as scroll button) then any finger movement on trackpad will be considered as scroll while the button is being pressed.
How to do this
First note that i am using libinput driver(recommended and available by default on most distros) than the synaptic driver.
Now do the following:
- open file /usr/share/X11/xorg.conf.d/40-libinput.conf (number can be different, smaller number means higer priority as compared to other scripts present in the directory) as root user.
- Now look for the para
Section "InputClass"
Identifier "libinput touchpad catchall"
MatchIsTouchpad "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
EndSection
Change this to
Section "InputClass"
Identifier "libinput touchpad catchall"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
Option "ScrollMethod" "button"
Option "ScrollButton" "3"
EndSection
Explanation
The line MatchIsTouchpad "on"
has been removed to apply these setting to pointer device also(which in this case your touchpad has already become after loading the psmouse with proto=imps option).
The line Option "ScrollMethod" "button"
is used to set the "scrollmethod" to "button" (other available options are "twofinger", "none", and "edge" none of which are working in my case).
The line Option "ScrollButton" "3"
is used to set the bottom right button on the touchpad as scrollbutton basically the button which when down will make any finger movement on touchpad as corresponding scroll.
The number "3" is generally the number assigned to the bottom right button, for bottom left button it is "1", you can also check the number assigned to each button via command xinput get-button-map <device-id>
(for example xinput get-button-map 10), where device-id is the device id of your touchpad which you can get via command xinput list
.
After all this you should have a working touchpad with button scroll enabled.
dmesg | grep psmouse
? Does it work before you log in? Can you check if it works inopenbox
session?sudo rmmod psmouse
followed bysudo modprobe psmouse
reloads a driver which sometimes helps to quickly get the mouse working again