- Chrome / Chromium средняя кнопка мыши для прокрутки Linux, Mac
- Получите ваш идентификатор устройства ввода
- С участием libinput
- Как настроить прокрутку элемента по зажатию средней кнопки мышки в Linux Xorg?
- Ubuntu Documentation
- Ubuntu Documentation
- Setting Forward And Back Buttons
- Install Programs
- Getting Button Numbers
- Scroll Wheel And Getting Buttons To Respond
- Rearranging buttons
- Setting up double click
- Additional Keys
- Application specific settings
- Evdev Driver
Chrome / Chromium средняя кнопка мыши для прокрутки Linux, Mac
Нажатие на среднюю кнопку не позволяет мне прокручивать страницу. Есть ли способ исправить это поведение?
- Ubuntu 10.10
- Хром 9.0.597.94
- Logitech MX518
Обновление : также Chrome и другие, основанные на Chromium.
В системах на базе Linux / Mac Google Chrome / Chromium не имеет этой функции. Вы должны получить расширение AutoScroll. Вот оно: AutoScroll
Это будет работать со всеми вашими приложениями без необходимости устанавливать что-либо.
Получите ваш идентификатор устройства ввода
В моем случае с идентификатором устройства Logitech M315 / M235 было 11.
Для получения списка доступных свойств используйте xinput list-props . Если вы используете libinput (будущее / настоящее), почти все свойства начнутся с libinput (также проверьте libinput list-devices ).
Вы всегда можете проверить свои устройства ввода с xev , evtest , xinput —test deviceID или libinput debug-events .
С участием libinput
Начиная с 17.04 Ubuntu использует libinput , поэтому для настройки свойств мыши:
- Метод прокрутки libinput Включено 3 логических значения (8 бит, 0 или 1) в порядке «два пальца», «край», «кнопка». Указывает, какой метод прокрутки в настоящее время включен на этом устройстве.
- Кнопка прокрутки libinput Кнопка 1 32-битное значение. Устанавливает номер кнопки для прокрутки кнопок. Этот параметр не зависит от метода прокрутки, для включения прокрутки кнопок необходимо установить метод прокрутки кнопок и установить действительную кнопку.
Источник
Как настроить прокрутку элемента по зажатию средней кнопки мышки в Linux Xorg?
Хочется сделать так, чтобы при зажатой средней (или правой) кнопке мышки таскание мышки вверх-вниз прокручивало текущий элемент интерфейса вверх-вниз, т.е. делало скроллинг также как будто я тяну за полоску скролла справа. Именно так работает работает прокрутке на ноутбуке через тачпад двумя пальцами вверх вниз, но на полноценном компьютере тачпада нет, а прокрутку очень хочется 😉
Насколько я разобрался, нужно копать где-то в огороде xorg xinput. По-идее такой функционал уже есть в системе, т.к. при использовании тачпада когда делаешь скролл вниз двумя пальцами — работает именно так как надо. Вопрос в том как привязать включение этого режима к зажатию средней кнопки мышки. При этом хотелось бы оставить работоспособным обычный клик мышкой как нажатие третьей кнопки мышки. Может быть xinput тут не причем и нужно копать в display manger (использую kdm), но там тоже не нашёл похожего ничего.
Плагины, которые делают подобное, встречаются для Firefox и Chrome, но хочется чтобы это работало не только в отдельных приложениях, а сразу во всех элементах системы (Использую Ubuntu с оболочкой KDE, но и в GTK-приложениях чтобы тоже работало). Либо, если это нельзя сделать через xorg, то хотя бы какую-то программу запускать которая это делает — тоже было бы годно. Для виндовсов я встречал такую программу (по правой кнопки скроллит списки, но это было лет 5 назад и название уже не вспомню никак), а в линухах что-то никак не найду как это можно сделать. Подскажите пожалуйста как это можно сделать или хотя бы в какую сторону копать?
Источник
Ubuntu Documentation
Many mice and some touchpads have a middle mouse button. On a mouse with a scroll wheel, you can usually press directly down on the scroll wheel to middle-click. If you don’t have a middle mouse button, you can press the left and right mouse buttons at the same time to middle-click.
На сенсорных панелях с поддержкой многопальцевого касания для воспроизведения нажатия колёсиком мышки, используется одновременное касание тремя пальцами. Чтобы включить эту возможность, отметьте параметр щелчок при касании в настройках сенсорной панели.
Многие приложения используют нажатие средней кнопки мыши для дополнительных действий.
In applications with scrollbars, left-clicking in the empty space of the bar moves the scroll position directly to that place. Middle-clicking moves up to a single page towards that location.
In the Activities overview, you can quickly open a new window for an application with middle-click. Simply middle-click on the application’s icon, either in the dash on the left, or in the applications overview. The applications overview is displayed using the grid button in the dash.
Most web browsers allow you to open links in tabs quickly with the middle mouse button. Just click any link with your middle mouse button, and it will open in a new tab.
В менеджере файлов нажатие средней кнопкой выполняет две роли. При нажатии средней кнопкой на папке она открывается в новой вкладке (как в веб-браузерах). Если же нажать средней кнопкой на файл, он будет открыт, как если бы было выполнено обычное двойное нажатие.
Some specialized applications allow you to use the middle mouse button for other functions. Search your application’s help for middle-click or middle mouse button .
Источник
Ubuntu Documentation
Discussion of this wiki can be found here
One major unresolved issue for many users switching to Linux is the ability to set an arbitrary (usually the middle or thumb) button on a mouse to «double click» (typically double «left click»). This wiki explains a reasonable solution to the problem, including enough additional details that most people should be able to work out how to customize their mice. These instructions rely only on X and distro-independent tools for it, so should work with most or all Linux distros with only minor changes. Parts of these instructions are known to work in multiple versions/releases of Ubuntu and Debian.
Setting Forward And Back Buttons
If all you want to do is set your four or five button mouse to use the extra buttons as «forward» and «back» buttons, you may have success with performing only a single action: edit /etc/X11/xorg.conf in the mouse section, and add the following two lines:
Make sure to backup the file first, and restart X to have the effect take place. Assuming you are one of the fortunate people who only wants these functions and whose mouse buttons map as the «standard» behavior, you’ll be all set. If it does not work, or you want other functions, you’ll need to follow the longer details below. (END SHORTCUT)
Install Programs
First, you need to install several programs. xbindkeys allows you to map any mouse (or keyboard) event to some program. xautomation is our gateway to setting up a «double click» event and mapping keyboard events to mouse buttons, and so it is not needed if you do not plan on using this.
NOTE: xvkbd seems to be the preferred tool in other threads instead of xautomation/xte, so if you wish you can use that instead of xautomation for all the same keyboard mapping tasks if you prefer that approach. xmacro is another tool that may work to replace xte for double click.
Open a terminal and type:
Getting Button Numbers
- Now we need to determine the «button number» of each physical button on your mouse.
This will open a window. Move your mouse cursor over it, and you’ll see a lot of output in your terminal; don’t worry about the output that happens when you move the mouse. One at a time, single click each button inside the «event tester» window, and note the 3rd line of output from either (or both) of the «ButtonPress» or «ButtonRelease» notices that pop up. The center item is «button X.» Make a note of the number that matches each physical button on your mouse. Also note if one or more buttons do not respond.
Scroll Wheel And Getting Buttons To Respond
First, get your scroll wheel working, if you have one. This will be approximate, but other guides available cover this in great depth if you need more help. Basically, the «scroll up» and «scroll down»are 2 more buttons on your mouse, so you will need to identify this as well using xev. Then type:
It is essentially to have a backup of xorg.conf, as messing it up can damage your ability to work to load your window environment. Search for «mouse.» It should look something like this (although you may have additional lines):
The only two lines we are going to touch are the «Protocol» and «ZAxisMapping» lines. Only change the Protocol line if one or more buttons did not respond. If you have unresponding buttons, chances are that you are using the PS/2 or IMPS/2 protocols, which may not allow for as many buttons (or the configuration) that you have, in which case try the ExplorerPS/2 as shown above. If you are already set to that and can’t get buttons to respond (or get multiple button events in response to a single click), you probably need to use the «evdev» driver, described near the bottom of this post.
ZAxisMapping refers to the scroll wheel. Basically, the simplest way to get the scroll wheel to work is to change the «6 7» above to match the two scroll button numbers from xev.
You will need to restart X (logout & press Ctrl + Alt + Backspace) to have these changes go into effect. If you changed the protocol, you will need to resume at the beginning (getting button numbers) as they will probably have changed. If your scroll wheel still does not work, try this in the terminal (the pointer should have as many numbers as from the -pp output, each only once):
This first outputs your current mapping of buttons. Basically, this means that the number shown (in the pointer) is the button # that triggers the events normally associated with the button position (i.e., here X & Y should be replaced with your 2 scroll buttons, to get them to trigger the 6 & 7 events). Note that if you use xmodmap, you will to auto-load this each time you start X (in Gnome, go to System -> Preferences -> Sessions -> Startup, and add the xmodmap command. Also note that xmodmap takes effect immediately; you do not need to restart.
You may also need to add a «buttons» option and try remapping in xorg.conf; see the other tutorials and this site for more details.
Rearranging buttons
As mentioned above, you can use xmodmap to rearrange buttons. This is useful if, as with a marble mouse, none of the buttons are set to be the «middle» button, which can be a problem in some programs. The middle button is button position 2. For example, a mouse may have 4 buttons, which are assigned numbers 1, 3, 8, and 9. In such a situation one would use this:
to assign button 8 to be the «middle button» (and assign position 8 to button 2, which does not exist). Note that this layout is for using it left-handed, so the right- & left-click buttons are swapped («normally» the 1 is left-click and 3 is right-click). In this case, positions which are assigned numbers 2 & 4-7 do not have any function, since this mouse does not have any of those button numbers. Again, you must run xmodmap each time you login for this to work.
Setting up double click
It’s taken a while to get here, but the unique point to this howto: setting an arbitrary button to be a «double click.» To follow what we’re going to do, understand that there is no such thing as a «double click» event. What we are actually going to do is assign a button to give 2 «left-click» events.
Installing xautomation provided us with several tools (use «man xautomation» if you’re curious), but the key one is «xte.» This allows us to send arbitray mouse (& keyboard) events to the kernel. We will also make use of xbindkeys to first trap the button event. First, create .xbindkeysrc, which xbindkeys uses for trapping events:
(The difference is whether you want the double click to to respond when you first click the mouse, or only when you release the button, respectively.) Replace «Y» in «b:Y» with the button number of the button you wish to assign to double-click. Save & close this file.
This starts xbindkeys running in the foreground, which means it will tell you if there are problems with your file. If you click the button Y, you should see xbindkeys provide trapping feedback upon release, and see feedback as well from button 1. Press «Ctrl + C» to stop this interface, then (if everything is working):
which will load xbindkeys in the background, and you should be set. As with xmodmap (end of the Scroll Wheel section), you need to add xbindkeys to start when X loads for this to work long-term.
Additional Keys
Basically, adding any other function to your mouse is going to use xbindkeys via the .xbindkeysrc file, except the command line will look something like this:
This example binds «Alt + Left Arrow» to button Z, which works as «back» in Firefox (and a variety of other applications). You can read many more examples of key combinations here using «man xte» or at the xbindkeys site: http://hocwp.free.fr/xbindkeys/xbindkeys.html . The examples there mostly show to how invoke programs, but you can still get the example keys and just substitute in the example above. Also at the site are scripts (and at least one example of how to use in their config files, possibly for invoking emacs two different ways) on mapping multiple events to a single button (e.g., if single click button Z, go back; if double-click, go forward).
For those wishing to set «scroll up» & «scroll down» buttons that repeat (i.e., advance multiple times instead of just once per click), it should be possible to set up a short script that loops the xte event & a short sleep event as long as the button is held down, and invoke that script in .xbindkeysrc, but this has not actually been tested. Also note that xbindkeys is a great way to get keyboard combinations working (e.g., that useless Windows key, the multimedia keys you may have, or other random combinations to load favorite programs).
Application specific settings
See this thread. Dealing with different settings for laptops when external mouse connected- see this thread for a start.
Evdev Driver
If you have multiple scroll wheels or buttons that are not recognized, you probably need to use the evdev driver. This is a little more complicated to set up. Much of this section is stolen from another mouse guide.
First you need to identify the name of your mouse (or its receiver, if wireless):
Which will yield output something like this (on my computer):
You are looking for the one that implies a mouse, or the manufacturer of your mouse (not the Macintosh mouse buttom emulation) and generally would refer to «mouse» in the «Handler» line of the section; in my cases, this is the 5th entry with the name «Logitech USB Trackball». Make a note of the name line, including all capitalization exactly.
Edit (after backing up!) your xorg.conf as described above, replacing the existing mouse section section (between the «Section. » and «End Section» lines) with this:
replacing Identifier to reflect what you wish to call your mouse, and the Option «Name» with the name of your mouse from the output desribed above.
Then replace the
near the bottom of xorg.conf with this (replacing your name as needed):
NOTE: If you using a laptop where your mouse will not always be connected, use «SendCoreEvents» instead of «CorePointer». Save & close xorg.conf and restart X, then resume the guide above (note that the ZAxisMapping trick won’t work with evdev). Also note with the evdev driver that some buttons will report two events (e.g., the «tilt wheel» of Logitech mice). The first button, usually the higher number, is the «start/stop» signal for the event, while the second button, usually lower and repeating, is the button you usually want to modify to change a function. A way has not yet been found on those mice to change which button is triggered (e.g., the «cruise» buttons on the Logitech MX1000 trigger buttons 4 & 5, which are the same as the scroll wheel, so you can’t change the cruise effect separately from an effect on the scroll wheel).
MouseCustomizations (последним исправлял пользователь elfy 2012-07-18 11:06:19)
The material on this wiki is available under a free license, see Copyright / License for details
You can contribute to this wiki, see Wiki Guide for details
Источник