- Mouse acceleration
- Contents
- Mouse acceleration with libinput
- Changing the acceleration
- Persistent configuration
- Setting mouse acceleration
- In Xorg configuration
- Using xset
- Using xinput
- Configuration example
- Disabling mouse acceleration
- with libinput
- Mouse buttons
- Contents
- Prerequisite testing mouse input in X
- Rebinding mouse and keyboard functions
- General purpose
- Key Mapper
- Binding mouse buttons to keyboard functions
- Binding keyboard keys to mouse buttons
- xvkbd and xbindkeys
- evrouter
- User tools
- evdev Xorg.conf setup
- Finding the mouse name
- Configuring Xorg
- evdev Xorg — Post configuration
- Google Chrome
- Opera
- Firefox
- Thumb buttons — forward and back
- xmodmap tweaking
- xinput tweaking
- Device-specific configuration
- Logitech G600
- Mad Catz Mouse
- Logitech M560/M545/M546
- Logitech G5 mouse: Binding + and —
- If Arch is a guest virtual machine
- VMware workstation
Mouse acceleration
The factual accuracy of this article or section is disputed.
Setting the mouse acceleration depends on the windowing protocol you are using: either Xorg or Wayland.
- On Xorg, there are several ways of setting mouse acceleration
- by editing Xorg configuration files
- xorg-xset and xorg-xinput which provide xset and xinput respectively
- and configuration interfaces common in desktop environments.
- If you are using Wayland, the events are controlled via libinput. It is the compositor’s job to expose the settings brought by libinput. There is currently no standard way to change settings across compositors.[1]
- GNOME manages mouse acceleration by itself. A choice between «adaptive» and «flat» profiles can be chosen by installing dconf-editor and editing the value in org/gnome/desktop/peripherals/mouse/acceleration-profile. Alternatively, gnome-tweaks can also be used to edit the org/gnome/desktop/peripherals/mouse/acceleration-profile.
Contents
Mouse acceleration with libinput
When using the adaptive pointer acceleration profile, libinput calculates the mouse acceleration depending on the DPI and the parameter Acceleration Speed [2]. libinput relies on the resolution reported by evdev [3]. Feedback settings set with xset m are effectively ignored. When using the flat pointer acceleration profile, the acceleration factor is constant regardless of the velocity of the pointer. This provides 1:1 movement between the device and the pointer on-screen.
Changing the acceleration
Find the id of your device with xinput list and set the acceleration speed with the following command. Note that the acceleration speed has to be in the range of [-1,1]. Check this plot to see the impact of different acceleration speed values.
Confirm your changes with the following:
Persistent configuration
libinput does not store configuration options, it is up to the caller to manage these. Under Wayland configuration is restored by the desktop environment. Under X xf86-input-libinput reads the xorg config files and applies the options [4]. To make changes persistent under X create a file like this:
For further options see libinput(4) .
Setting mouse acceleration
In Xorg configuration
This article or section needs language, wiki syntax or style improvements. See Help:Style for reference.
You can also assign settings to specific hardware by using «MatchProduct», «MatchVendor» and other matches inside class sections. Run lsusb to find out the product name and vendor to match:
If you are unable to identify your device, try running xinput list . Some devices the use Logitech Unifying Recceiver share the same USB connection therefore, the mouse do not appear using lsusb
Using xset
To get the current values, use:
To set new values, type:
where acceleration defines how many times faster the cursor will move than the default speed. threshold is the velocity required for acceleration to become effective, usually measured in device units per 10ms. acceleration can be a fraction, so if you want to slow down the mouse you can use 1/2, 1/3, 1/4, . if you want to make it faster you can use 2/1, 3/1, 4/1, .
Threshold defines the point at which acceleration should occur in pixels per 10 ms. If threshold is zero, e.g. if you use:
as suggested in the man page, then acceleration is treated as «the exponent of a more natural and continuous formula.»
To get the default settings back:
For more info see xset(1) .
Commands may be stored in Xinitrc or Xprofile. Alternatively, create a Desktop entry in .config/autostart :
This technique may be more desirable than employing the xorg configuration technique described above; latter may interfere with setting mouse speed in a display manager.
Using xinput
First, get a list of devices plugged in (ignore any virtual pointers):
Take note of the ID. You may also use the full name in commands if the ID is prone to changing.
Get a list of available properties and their current values available for modification with
where 9 is the ID of the device you wish to use. Or
where mouse brand is the name of your mouse given by $ xinput list
Example, changing the property of Constant Deceleration to 2:
To make it permanent, edit xorg configuration (see above) or add commands to xprofile. The latter will not affect speed in a Display manager.
Configuration example
You may need to resort to using more than one method to achieve your desired mouse settings. Here is what I did to configure a generic optical mouse: First, slow down the default movement speed 3 times so that it is more precise.
Then, enable acceleration and make it 3 times faster after moving past 6 units.
If you are satisfied of the results, store the preceding commands in
Disabling mouse acceleration
Mouse acceleration has changed dramatically in recent X server versions; using xset to disable acceleration does not work as it used to and is not recommended anymore. Recent changes on PointerAcceleration can be read here.
Disabling the mouse acceleration means that a linear function will be used to map from physical to virtual mouse movements. The mouse speed setting controls the inclination of this linear function.
To completely disable any sort of acceleration/deceleration, create the following file:
with libinput
Alternatively, since libinput -1.1.0-1 and xf86-input-libinput -0.15.0-1 you can use a flat acceleration profile. To enable it create the following file:
and restart X. Notice that under certain conditions (for example if you have a different Pointer Speed value for your mouse in Plasma 5.13) your desktop environment may try to override some of these values even if you have this X configuration file.
Another option is this command:
Which does not need an X restart, but is not persistent. Although it can be set up to run automatically with Autostarting.
To confirm that acceleration has been disabled, enter the following:
Источник
Mouse buttons
This article or section needs language, wiki syntax or style improvements. See Help:Style for reference.
The factual accuracy of this article or section is disputed.
This article describes how to configure a mouse with more than 3 buttons.
Contents
Prerequisite testing mouse input in X
This page assumes you are using Xorg (X Window System) and not Wayland.
You will first want to check what X sees from your mouse. X events can be displayed by the xev utility. A window will pop up by running
Any xevents (like moving, resizing, or clicking in) that window will then be reported to the console you launched xev from. Since you are filtering for lines which contain «button» it will show mouse click and release events with their relevant button numbers. For most mice, this will be ‘1’ for left button, ‘2’ for middle, ‘3’ for right. Other buttons will vary (e.g. for an Logitech MX Master 3 the scroll wheel is 4 & 5, thumb wheel is 6 & 7, the thumb-tip button is 9, and the inner-thumb button is 8).
This corresponds to a left mouse click and release followed by a thumb-tip click and release.
You can use xev to confirm your mouse button numbers and to confirm that X is being notified of mouse clicks.
Rebinding mouse and keyboard functions
This section covers details of using various tools to rearrange mouse and keyboard functions.
General purpose
Key Mapper
key-mapper-git AUR is a GUI tool with a simple interface to remap your mouse and or keyboard keys. [1] Usage explained.
Binding mouse buttons to keyboard functions
This article or section needs language, wiki syntax or style improvements. See Help:Style for reference.
xte from xautomation comes handy when we want to bind keyboard buttons to mouse.
Here is example
/.xbindkeysrc which binds Shift_R to mouse button 3 («right click»):
Binding keyboard keys to mouse buttons
xvkbd and xbindkeys
This article or section needs language, wiki syntax or style improvements. See Help:Style for reference.
Let us say we want to bind some mouse buttons to keyboard ones. The problem we will encounter is that we do not know how to emulate a key press. Here comes in handy xvkbd AUR . We can use it along with xbindkeys .
To restart xbindkeys type:
Here is example
If you want to check your mouse buttons number use xev. Do not forget to type capital letters in xvkbd -text usage and to escape opening bracket with \ or you get simply [Shift] written.
Here is an example for xbindkeys to enable x selection paste(third click pasting), you need both xsel and xvkbd installed, What it does it executes that command whenever button 13 of the mouse is pressed (in
This is an example for a keybinding for Meta+M:
evrouter
This article or section needs expansion.
Some programs, especially games, use different methods of reading input, so another program is needed: evrouter AUR .
For the evrouter command to be able to read the input devices, it will have to be run in the input group (or as root). This can be achieved by adding yourself to that group:
Now we can use the —dump option to display what the button to be changed is called:
Now press the buttons that you wish to change:
The line that ends with «fill this in!» can be copied into the config file which by default is
/.evrouterrc . For example, using the X11 key event emulator built into evrouter:
The ‘event1’ was changed to ‘event*’ in case udev gives it a different device number at boot. The ‘none’ was changed to ‘any’ so that the rule works even if any modifier keys are pressed when the button is pressed. To determine the key codes (in brackets) you can use
See evrouter(1) for a full explanation of the fields.
After setting up the config file, run it as a daemon:
To stop the daemon:
User tools
This section outlines tools which are useful for configuring mouse settings, and in particular their buttons.
piper is a graphical user interface to configure gaming mice, works with Wayland. In order to work with your mouse, it must be in the list of supported devices.
wayland-mouse-mapper is a small script for mapping mouse buttons to keystrokes on Wayland.
IMWheel provides configurable mouse wheel and button mapping. It can be configured globally or for individual processes.
/.imwheelrc to enable back/forward thumb buttons for all applications and increased scroll speed in Chromium:
lomoco AUR for Logitech MX mice will help you set the proper resolution, enable or disable smart scroll (with boot time support too!), etc.
Be sure to look at /etc/udev/lomoco_mouse.conf and set up the the options you want to be automatically applied when the mouse gets loaded by udev.
key-mapper-git AUR works with both X and Wayland and provides a GUI to configure input devices.
logiops-git AUR is a tool for configuring Logitech mouses (Logitech Options for Linux). It may remap buttons to actions, support gestures, smart shift and so on.
evdev Xorg.conf setup
This section explains setting up mice with more than 3 buttons using evdev . There are other ways to achieve this, but some of the notes and tools described here may be useful for people with other needs. Some parts may help getting extra mouse buttons working using other drivers as well.
We will be using the evdev driver for Xorg. EVentDEVice is an advanced driver for USB input devices which offers much greater power over the standard Xorg mouse driver. It is also more «direct» than the mouse driver, allowing lower latency and less translation issues.
- Note that evdev is both a kernel module and an Xorg input driver. All the Arch kernels come with the evdev module.
With the Xorg 11R7.0 or newer, only the following changes to /etc/X11/xorg.conf need to be made.
Finding the mouse name
The first step is to find the name of the mouse / mice. To do this, execute the following command:
This should output something like this:
Or this if you have more than one mouse:
The mouse is the one that has the Handlers=mouse0 , so the name of the device is Logitech USB Gaming Mouse .
Copy the name of the device, and open up /etc/X11/xorg.conf .
Configuring Xorg
Now, we need an entry in xorg.conf that tells X how to use this mouse. It should look something like this:
Replace the Name option with the name you copied from above. You may also omit the CorePointer option if you use multiple mice or experience errors when attempting to load Xorg. The other options are all basic mouse configurations for evdev and should work with most mice.
Next, we need to tell X to use the mouse, so look in xorg.conf for ServerLayout .
Modify the ServerLayout section to use «Evdev Mouse» as the device. When you are done, it should look something like this:
The only thing you should change in the layout is the InputDevice line that refers to your mouse.
That should be all that is required.
This is for Logitech G5 Mouse users. I have not tested this for other mice, but if you do not add this, your mouse MAY not work. If you do not need to add this, then do not.
in the InputDevice section or else the mouse will not be picked up.
[#] = The number you got from:
With the above method, your mouse might not to work after reboot (event number changes). To fix this, you can use symlinks in /dev/input/by-id . For example:
To find the appropriate id, do:
This article or section is out of date.
With a Desktop type keyboard-mouse, this does not work because there is only one USB attachment and /dev/input/by-id contains only the keyboard. In this case, we can create a udev rule to get a consistent link. The following rules create the link /dev/input/usbmouse which points on the correct event entry:
You can call it z10_usb_mouse.rules and put it in /etc/udev/rules.d
The cryptic value to use for SYSFS(modalias) can be gotten in the following way:
enter the command cat /proc/bus/input/devices
You will find the keyboard and the mouse and see event4 is the mouse in this case:
So I enter the following command (adapt event # to your particular case):
grab the ATTRS which becomes with usb: to complete «SYSFS
And finally, use usbmouse as the Device Option in xorg.conf :
evdev Xorg — Post configuration
Google Chrome
It works. Horizontal scroll works out of the box — push the scroll wheel left or right. Thumb buttons also work as next/previous page.
Opera
It works. Note: buttons can be mapped to functions easily in Preferences > Advanced > Shortcuts > Mouse set-up . For example, to bind button 8 to back:
- Navigate to mouse set-up and expand the Application drop-down
- In the input column, type: Button 8
- In the actions column, type: Back
Firefox
Horizontal scroll
To get back and forward enabled, instead of scroll left/right, change the following settings in about:config :
Thumb buttons — forward and back
To do this we need to map keystrokes to the desired mouse buttons and install xvkbd AUR and xbindkeys .
In most modern applications which use back/forward features, XF86Back is mapped to back and XF86Forward is mapped to forward by default. On most MX mice the thumb buttons resolve to 8 & 9. If your mouse is different, check button numbers using xev and replace the numbers used in the example (b:8 & b:9).
So if you have an MX mouse you would create the file
Now to test. Run the following command and if it works as expected remember to add xbindkeys to .xinitrc or somewhere where it will be executed each time X starts. Also, this should work with Epiphany and Konqueror without any additional configuration or use of IMWheel.
Since xvkbd is not available from the official repositories here is another example using xte from the xautomation package
The above info and more help may be found in the MX1000 Buttons wiki.
xmodmap tweaking
It may prove to be more comfortable for some to change the ordering of button codes, as the case may be for left-handed people. Depending on the environment you use, the button codes can be configured in two different ways. If you use .xinitrc to load X, then add this to .xinitrc (change for the number of buttons you have):
Note that buttons 4 and 5 must go on the end or else your scroll wheel will not work.
If you use GDM/XDM/KDM instead of .xinitrc , then create the file
/.Xmodmap and add this to it (change for the number of buttons you have):
- GDM/XDM/KDM read the
/.Xmodmap file if it is present, whereas startx does not. Another solution would be to add this to your
/.Xmodmap . This would allow you to use *DM and startx while only having to edit
/.Xmodmap when you need to make changes.
You may have to play with these numbers a bit to get your desired behavior. Some mice use buttons 6 and 7 for the scroll wheel, in which case those buttons would have to be the last numbers. Keep playing with it until it works!
xinput tweaking
For debugging purposes xinput can be used as it is able to change the button map on the fly in userspace. The following line corrects the button mapping (there have been reported cases with Logitech M505/B605 mice and possibly others) so the received events are mapped correctly:
Device-specific configuration
Logitech G600
It is known that in xorg-server 1.18.0-3 side buttons of G600 are not recognized as a separate keyboard device, but another mouse which causes strange (moving mouse cursor to an edge of screen when one of main mouse buttons are clicked) behavior. To force xorg to recognize them as a keyboard buttons, add following section to your /etc/X11/xorg.conf :
Mad Catz Mouse
Logitech M560/M545/M546
These mice are designed for Windows 8 and have non-conventional behavior: the mouse appears as a mouse and keyboard and some buttons do not emit the standard mouse button event but a combination of keyboard and mouse button presses instead. This prevents «comfortable» use of this mouse under Linux.
The appropriate driver allows the mouse to be used like an ordinary mouse:
This article or section needs language, wiki syntax or style improvements. See Help:Style for reference.
- kernel module for M560 (already merged into kernel v4.2)
- kernel module for M545/M546
See also Xbindkeys for mouse button mapping.
Logitech G5 mouse: Binding + and —
If you want to bind the buttons + and — in G5/7 mouse, which normally changes DPI, you have to use g5hack [4] released by a lomoco author.
This will change your DPI to 2000, light the 1st LED and disables DPI on-the-fly changing, so you can use it with evrouter. If you would use it frequently I suggest you to copy it to the /usr/bin directory:
If you want to bind your + and — buttons you must copy the line at the bottom (one with the comment ‘»-» button does not function anymore’ above) to the mode you will be using, like, for example, under the «case 3:» you can put it on the line with the comment ‘turn on third led’ above (deleting the old one before of course).
For the newest G5 mouse which is reported as «product 0xc049» original hack does not work. You have to simply change the #define MOUSE_G5 0xc041 to #define MOUSE_G5 0xc049 and recompile.
You can execute the g5hack tool at system start up using systemd unit. See Systemd#Writing unit files for detail.
If Arch is a guest virtual machine
If you want to support more than two or three mouse buttons, the capability will depend on your hypervisor software.
VMware workstation
For your Arch-based guest VM, add the below lines to its .vmx configuration file:
Источник