Hi!
Problem in short: In my usage scenario of X and mouse I got mouse stops working. If restart X session, functionality restores, if without restarting X plug in USB mouse, it moves the cursor, but after some time, or after plug-out system crushes.
I'm running
on Dell Latitude E6420. Here is ALPS Touchpad, that sadly still not recognized by psm(4).
So I've managed to configured it -- PS/2 mouse -- as close to expectations, as possible.
Related configs:
/etc/rc.conf
This emulates third (middle button), and virtual scrolling, that I do not understand where and how to be used.
Resolution and acceleration, make it close to touchpad feeling, psm(4):
/boot/device.hints
Here I may say, that in conosole I have no problems. Problems arise in Xorg.
Xorg-related config:
/usr/local/etc/X11/xorg.conf.d/30-alps.conf
Until there all feels ok, except that it's not touchpad, thus now edge scrolling and other things, but it can be used.
One thing is very annoing: tapping (mouse clicking) with palm, whet I typing text, Very annoying. For touchpad,
especially, synaptics, there is syndaemon, that listening for keypresses and disables tapping for a while. Moreover, in
linux (I mean Debian, do not know other defaults), for example, for years there defaults do not enable tapping, only physical keys.
Anyway, there no widespread tool for my case, when touchpad is detected as PS/2 mouse.
But I found a simple script for such task here
https://superuser.com/questions/1284275/disable-mouse-when-keyboard-key-is-pressed-in-linux
I adopted code for sh(1). With some experimenting code in my case it looks like this:
This code listens to key presses, disables mouse by xinput for a while. It does the job.
But there another problem: after some random time -- it may be a day, or an hour -- mouse stops working (in X).
Sympthoms:
* mouse cursor do not move
* in
* in Xorg.0.log
Upper "II" messages -- normal work of that script, enabling and disabling mouse. "[dix]" messages indicates a problem.
At this time mouse works good in vtys, if switching to by Alt-Fx.
If now I restart X session, e.g. by logging off, I see working mouse already in Lightdm, and of course, later in logged session.
But if I do not want to exit X session and try to connect USB mouse to finish my work, It works some time,
but after some time, or (maybe, only if) USB mouse unplugged, system crashes, writing /var/crash/vmcore.N.
Usually there current process is moused, but not always.
Can you suggest something to cope with it? Debug output it steel greek to me. Maybe it's time to post it to some mailing list? I'm still not familiar with lists.
P.S. Of course, I'm curious, if problem is solely X-related, or X-port in FreeBSD related, or FreeBSD related. In linux touchpad working, so no such harsh use of on/off scenario.... But maybe I test that....
Problem in short: In my usage scenario of X and mouse I got mouse stops working. If restart X session, functionality restores, if without restarting X plug in USB mouse, it moves the cursor, but after some time, or after plug-out system crushes.
I'm running
Code:
FreeBSD bsd15 15.0-RELEASE-p4 FreeBSD 15.0-RELEASE-p4 releng/15.0-n281010-8ef0ed690df2 GENERIC amd64
So I've managed to configured it -- PS/2 mouse -- as close to expectations, as possible.
Related configs:
/etc/rc.conf
Code:
moused_enable="YES"
moused_flags="-3 -V"
Resolution and acceleration, make it close to touchpad feeling, psm(4):
/boot/device.hints
Code:
hint.psm.0.flags="0x24"
Here I may say, that in conosole I have no problems. Problems arise in Xorg.
Xorg-related config:
/usr/local/etc/X11/xorg.conf.d/30-alps.conf
Code:
Section "InputClass"
Identifier "alps-as-mouse"
Driver "libinput"
MatchProduct "Generic PS/2 mouse"
MatchIsPointer "true"
Option "ScrollMethod" "button"
Option "NaturalScrolling" "true"
EndSection
Until there all feels ok, except that it's not touchpad, thus now edge scrolling and other things, but it can be used.
One thing is very annoing: tapping (mouse clicking) with palm, whet I typing text, Very annoying. For touchpad,
especially, synaptics, there is syndaemon, that listening for keypresses and disables tapping for a while. Moreover, in
linux (I mean Debian, do not know other defaults), for example, for years there defaults do not enable tapping, only physical keys.
Anyway, there no widespread tool for my case, when touchpad is detected as PS/2 mouse.
But I found a simple script for such task here
https://superuser.com/questions/1284275/disable-mouse-when-keyboard-key-is-pressed-in-linux
I adopted code for sh(1). With some experimenting code in my case it looks like this:
Code:
#!/usr/bin/env sh
DEBUG=0
PID_FILE="/tmp/mouseswd-sh.pid"
# start delay
SDELAY=1
# mouse off delay
MDELAY=1.5
#mouse
MNAME="Generic PS/2 mouse"
MID=$(xinput list --id-only "$MNAME")
#keyboard
KBNAME="AT keyboard"
KBID=$(xinput list --id-only "$KBNAME")
# key codes
LCTRL=37
RCTRL=105
LSHIFT=50
RSHIFT=62
LALT=64
RALT=108
LWIN=133
RWIN=134
MENU=135
VOLUP=123
VOLDOWN=122
VOLMUTE=121
wait_and_enable()
{
sleep $MDELAY
if [ "x$DEBUG" = "x1" ]
then echo "Enabling mouse"
fi
xinput enable $MID
}
polite_exit()
{
kill $(jobs -s) 2>/dev/null
kill $(jobs -p) 2>/dev/null
xinput enable $MID
rm $PID_FILE
if [ $# -gt 0 ]
then
echo Exiting by signal $1
else
echo Exiting ...
fi
exit
}
debug_on()
{
DEBUG=1
}
debug_off()
{
DEBUG=0
}
debug_toggle()
{
DEBUG=$(($DEBUG^1))
}
readcmds()
{
echo start readcmds...
while read -p "Command:" c
do
echo got command $c
case $c in
"d"|"D")
debug_toggle ;;
"l"|"L")
jobs -l ;;
"s"|"S")
xinput ;;
"f"|"F")
kill -USR1 `jobs -p`;;
esac
done
}
### main
trap debug_on USR1
trap debug_off USR2
trap "polite_exit 0" EXIT
trap "polite_exit 1" HUP
trap "polite_exit 2" INT
trap "polite_exit 3" QUIT
trap "polite_exit 9" KILL
trap "polite_exit 15" TERM
#my PID
PID=$$
echo My pid is $PID
echo $PID > "$PID_FILE"
#pause
echo Wait a little...
sleep $SDELAY
echo Start
xinput test $KBID | while read key event code
do
if [ $DEBUG -eq 1 ]
then
echo got $key -- $event -- $code
fi
case $code in
$LCTRL|$RCTRL|$LSHIFT|$RSHIFT|$LALT|$RALT|$LWIN|$RWIN|$MENU|$VOLUP|$VOLDOWN|$VOLMUTE)
if [ $DEBUG -eq 1 ]
then echo "modifier key $code"
fi
: ;;
*)
if [ $DEBUG -eq 1 ]
then
echo "other key $code, disbling mouse"
echo current jobs: $(jobs -p)
#echo xinput job: $(pgrep -lf xinput)
fi
xinput disable $MID
kill $(jobs -p) 2> /dev/null
(wait_and_enable)& ;;
esac
done
This code listens to key presses, disables mouse by xinput for a while. It does the job.
But there another problem: after some random time -- it may be a day, or an hour -- mouse stops working (in X).
Sympthoms:
* mouse cursor do not move
* in
xinput output all devices enabled, like this
Code:
taras@bsd15:~ % xinput
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ System mouse id=7 [slave pointer (2)]
⎜ ↳ Generic PS/2 mouse id=11 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ System keyboard multiplexer id=6 [slave keyboard (3)]
↳ Power Button id=8 [slave keyboard (3)]
↳ Sleep Button id=9 [slave keyboard (3)]
↳ AT keyboard id=10 [slave keyboard (3)]
↳ ACPI video extension id=12 [slave keyboard (3)]
↳ ACPI video extension id=13 [slave keyboard (3)]
Code:
1013.462] (II) event6 - Generic PS/2 mouse: device is a pointer
[ 1017.749] (II) event6 - Generic PS/2 mouse: device removed
[ 1019.553] (II) event6 - Generic PS/2 mouse: is tagged by udev as: Mouse
[ 1019.558] (II) event6 - Generic PS/2 mouse: device is a pointer
[ 1021.038] (II) event6 - Generic PS/2 mouse: device removed
[ 1025.939] (II) event6 - Generic PS/2 mouse: not tagged as supported input device
[ 1025.939] (II) event6 - not using input device '/dev/input/event6'.
[ 1025.939] [dix] couldn't enable device 11
[ 1027.403] [dix] couldn't enable device 11
[ 1047.147] [dix] couldn't enable device 11
[ 1065.241] [dix] couldn't enable device 11
[ 1072.174] [dix] couldn't enable device 11
[ 1078.280] [dix] couldn't enable device 11
At this time mouse works good in vtys, if switching to by Alt-Fx.
If now I restart X session, e.g. by logging off, I see working mouse already in Lightdm, and of course, later in logged session.
But if I do not want to exit X session and try to connect USB mouse to finish my work, It works some time,
but after some time, or (maybe, only if) USB mouse unplugged, system crashes, writing /var/crash/vmcore.N.
Usually there current process is moused, but not always.
Can you suggest something to cope with it? Debug output it steel greek to me. Maybe it's time to post it to some mailing list? I'm still not familiar with lists.
P.S. Of course, I'm curious, if problem is solely X-related, or X-port in FreeBSD related, or FreeBSD related. In linux touchpad working, so no such harsh use of on/off scenario.... But maybe I test that....