[SOLVED]Configuring Mouse in Stretch

Getting your soundcard to work, using Debian on non-i386 hardware, etc

[SOLVED]Configuring Mouse in Stretch

Postby geoffkaniuk » 2017-09-15 11:12

PROBLEM
I have recently installed Debian 9.1 plus Mate 1.16 on a pristine PC with Asus motherboard and Intel quad core processor. My problem is that the mouse is too lively.

SOLUTIONS ATTEMPTED
The Mate desktop has Mouse Pointer acceleration and sensitivity configuration in its System>Preferences>Hardware>Mouse section. Changing these has no discernible effect whatsoever. I have searched for an Xorg configuration file, but the only configuration in the system is in files in /usr/share/X11/xorg.conf.d. The file that seems relevant has one section relating to the pointer:
Code: Select all
FILE:  /usr/share/X11/xorg.conf.d/40-libinput.conf
Section "InputClass"
        Identifier "libinput pointer catchall"
        MatchIsPointer "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
EndSection


I have used Xorg's configuration utility to produce a configuration file. It has one section relating to the Logitech mouse, which has just the usual two buttons and centre scroll wheel:
Code: Select all
~# Xorg :1 -configure
(EE) Server terminated with error (2). Closing log file.

FILE /root/xorg.conf.new
Section "InputDevice"
   Identifier  "Mouse0"
   Driver      "mouse"
   Option       "Protocol" "auto"
   Option       "Device" "/dev/input/mice"
   Option       "ZAxisMapping" "4 5 6 7"
EndSection

Given the error response, I did not try this configuration.

COMPARISON WITH JESSIE
The Jessie mouse works fine, and I can adjust its settings from Mate. The mouse seems to be configured in a different way in Jessie via a vmmouse configuration file (I am not using a Virtual Machine by the way):
Code: Select all
FILE: /usr/share/X11/xorg.conf.d/50-vmmouse.conf
Section "InputClass"
   Identifier   "vmmouse"
   MatchIsPointer   "on"
   MatchTag   "vmmouse"
   Driver      "vmmouse"
EndSection

However, vmmouse is supplied by the package xserver-xorg-input-vmmouse, which no longer exits in Stretch.

I would be very grateful if someone can point me in the right direction. Is there is a missing driver?

I am happy to supply any further details as needed to resolve this issue.

Many thanks for any light you can shed here.
Last edited by geoffkaniuk on 2017-09-21 12:14, edited 1 time in total.
Geoff
geoffkaniuk
 
Posts: 43
Joined: 2010-05-30 23:09
Location: Cambridge

Re: Configuring Mouse in Stretch

Postby bigrigdriver » 2017-09-16 13:06

Registered GNU/Linux user #170078

Go as google before you ask on these boards.

It it isn't broken, Tweak It !!!
bigrigdriver
 
Posts: 134
Joined: 2014-09-01 17:04
Location: East Central Illinois, USA

Re: Configuring Mouse in Stretch

Postby gurfle » 2017-09-19 14:07

The only way I get mouse configuration to work under mate in stretch is with xinput (you must first install its package). For example, to enable third button emulation on my wireless mouse, I use this:
Code: Select all
#!/bin/bash
# The above is critical for some of the syntax below, such as "( ( [" to work
# #  An attempt to generalize the idea of Remko Bolt at https://www.mattfischer.com/blog/archives/343
# #  to enable mouse middlebutton emulation.
xinputcmd=/usr/bin/xinput
echocmd=/bin/echo
grepcmd=/bin/grep
sedcmd=/bin/sed
sortcmd=/usr/bin/sort
xidlist=`$xinputcmd list | $grepcmd "ceiver.*slave  pointer" | $sedcmd 's/^.*id=//' | $sedcmd 's/       .*$//' | $sortcmd` #  sort not really needed here
xid=
for tid in $xidlist
do
  property=`$xinputcmd list-props $tid | $grepcmd "Middle Emulation Enabled (" | $sedcmd 's/^.*(//' | $sedcmd 's/).*$//'` #  Is this a good test?
  if ( ( [ x$xid == x ] ) && ( [ x$property != x ] ) )
  then
    xid=$tid
  fi
done
if [ x$xid != x ]
then
  #  xid should now contiain the xinput id of the last occurance of "ceiver.*slave  pointer" in "xinput list" command output.
  #  Not too sure if this will always be a wireless mouse though.
  property=`$xinputcmd list-props $xid | $grepcmd "Middle Emulation Enabled (" | $sedcmd 's/^.*(//' | $sedcmd 's/).*$//'`
  $xinputcmd set-prop $xid $property 1
fi

You might have to adapt some of the checks for labels if they are different on your system. Use "xinput list" and "xinput list-props" from the command line to see what they are.
If you put this in an executable file, say /etc/lightdm/middlemousebutton.sh, and then put (or rather un-comment and edit) the line
display-setup-script=/etc/lightdm/middlemousebutton.sh
in /etc/lightdm/ightdm.conf
it will be executed at boot up time.

Beware though, because if something goes wrongs, mate may not start at all! Most commonly this happens, if you forget to make the script file executable. You then have to somehow access and fix any errors like that via some rescue mode.

Xorg.conf doesn't seem to do anything in mate, nor does the gnome gsettings utility, but xinput seems to cover everything those things used to for input devices. At any rate I've made some useful scripts to manage not just mouse, but also touchpad settings, and it looks like it can manage keyboard settings as well.

Good luck, and do let us know if this was helpful or not.
Last edited by gurfle on 2017-09-21 14:44, edited 1 time in total.
User avatar
gurfle
 
Posts: 333
Joined: 2009-06-04 02:08
Location: Seattle, Washington, US

Re: Configuring Mouse in Stretch

Postby geoffkaniuk » 2017-09-21 12:13

TO bigrigdriver: Thank you for your very useful link https://lists.debian.org/debian-user/2017/08/msg00404.html.

This gives an example for a Section "InputCLass" to be inserted in the file /etc/X11/xorg.conf.d/10-libinput.conf (which did not exist on my installation). My searches trying to get more information on libinput and the meaning of the various options, led me via the excellent Archlinux wiki reference contained in the above post to the wayland site https://wayland.freedesktop.org/libinput/doc/. I was also directed to the xinput command, allowing me to experiment with different settings for acceleration speed before creating the libinput.conf file:

Code: Select all
~# xinput --set-prop 'Logitech USB-PS/2 Optical Mouse' 'libinput Accel Speed' -0.1

FILE 10-libinput.conf
Section
"InputClass"
  Identifier "mouse"
  Driver "libinput"
  Option "AccelProfile" "flat"
  Option "AccelSpeed" "-0.1"
EndSection

Following a re-boot, my mouse is now well-behaved. Many thanks :D

TO gurfle: During my searches I kept seeing references to middle mouse button emulation in askubuntu, which seemed to be solved with libinput. Seems a pity it did not work for you. These posts are indeed very helpful and do provide material which hopefully helps others to get to solutions more quickly.
Geoff
geoffkaniuk
 
Posts: 43
Joined: 2010-05-30 23:09
Location: Cambridge

Re: Configuring Mouse in Stretch

Postby gurfle » 2017-09-21 16:00

geoffkaniuk wrote:[TO gurfle: During my searches I kept seeing references to middle mouse button emulation in askubuntu, which seemed to be solved with libinput. Seems a pity it did not work for you. These posts are indeed very helpful and do provide material which hopefully helps others to get to solutions more quickly.

Actually, (as my post indicates) I am able to do everything directly with xinput. I am not sure if libinput is even involved with that, but if so, then only indirectly.
Thanks nonetheless for clarifying how to use the new way of configuring input devices with Xorg via libinput, which I had missed and is clearly the more dependable and "correct" way. While it is possible to get xinput to do the same job at startup in mate, to do so as I describe is certainly more of a roundabout hack. xinput is really only meant for use at runtime, not really at desktop startup - mate just happens to be flexible enough that xinput's use for startup purposes is in fact feasible, though not terribly robust. xinput is however ideal for changing mouse and touchpad settings on the fly, allowing me for example to create desktop panel buttons to toggle between right and left-handed mouse or enable/disable the touchpad, things that I frequently need to do.
User avatar
gurfle
 
Posts: 333
Joined: 2009-06-04 02:08
Location: Seattle, Washington, US


Return to Hardware

Who is online

Users browsing this forum: No registered users and 4 guests

fashionable