ButtonMapping - Parámetros posicionales


11

En un archivo de configuración X, los botones del mouse pueden asignarse usando una opción ButtonMapping:

Section "InputClass"
    # ...
    Option "ButtonMapping" "1 9 3 4 5 6 7 8 2"
    # ...
EndSection

Cambiar el orden de los números cambia el comportamiento de los botones del mouse. Sin embargo, no puedo encontrar ninguna documentación que describa cómo se asigna el comportamiento. Qué poca documentación hay, ayudé a escribir.

Por ejemplo, si la asignación de botones se escribió así:

    Option "ButtonMapping" "a b c d e f g h i"

Documentaríamos estas posiciones como:

  • a - Clic izquierdo
  • b - Medio
  • c - clic derecho
  • d - Desplazarse hacia adelante
  • e - Desplazarse hacia atrás
  • f - Adelante
  • g - hacia atrás
  • h - Desplazamiento horizontal
  • i - Desplazamiento vertical

Mi pregunta entonces: ¿Qué significan los valores de posición de un medio que representan en realidad y cómo se asignan a los botones del ratón?

Actualizar

Ejecución de xmodmap -ppespectáculos:

$ xmodmap -pp
There are 10 pointer buttons defined.

    Physical        Button
     Button          Code
        1              1
        2              2
        3              3
        4              4
        5              5
        6              6
        7              7
        8              8
        9              9
       10             10

Esto no es útil ya que no contiene información que un humano pueda usar sobre los atributos físicos del mouse (es decir, mostrar dos columnas de números es inútil sin los nombres de los botones, como "botón izquierdo"). Entonces, aunque técnicamente esto podría responder la pregunta de "cómo se mapean", la pregunta sigue sin respuesta en ningún sentido práctico.


AFAICG, los valores son los números de botón según lo informado por xev. Así, por ejemplo, en su ejemplo, el botón superior derecho de mi trackball Kensington Slimblade es el número 8, asignado al desplazamiento horizontal (hacia atrás, en los navegadores web).
Lfd

Respuestas:


2

Creo que deberías verlo de esta manera:

                        1 2 3 4 5 6 7 8 9  <--position-- physical keys
Option "ButtonMapping" "1 9 3 4 5 6 7 8 2" <--function-- logical keys
  • La posición que indica la identificación de la llave según lo informado por el mouse (a través del controlador). Entonces, depende del fabricante cómo ordenarlos, sin embargo, la mayoría se apega al orden común.

    Los ratones que todavía usan los protocolos antiguos como PS2, no tienen una forma de almacenar o decir información sobre los botones disponibles y sus funciones. Entonces, el servidor X no puede decirle la identificación de cada botón físico, solo probándolos usando una herramienta como xevesa que muestra los eventos X:

    xev -event mouse
    

    O evtesteso muestra los eventos en bruto:

    sudo evtest
    
  • La clave lógica son las asignadas en algún otro lugar para funciones adicionales. En este nivel, X los mira como: botón1, botón2, botón3, botón4, ..., botón24 y no conoce su función.

Ejemplos oficiales de referencia:

  7.  Configuration Examples

  This section shows some example InputDevice section for popular mice.
  All the examples assume that the mouse is connected to the PS/2 mouse
  port, and the OS supports the PS/2 mouse initialization.  It is also
  assumed that /dev/mouse is a link to the PS/2 mouse port.

  Logitech MouseMan+ has 4 buttons and a wheel. The following example
  makes the wheel movement available as the button 5 and 6.

  Section "InputDevice"
          Identifier      "MouseMan+"
          Driver          "mouse"
          Option          "Device"    "/dev/mouse"
          Option          "Protocol"  "MouseManPlusPS/2"
          Option          "Buttons"   "6"
          Option          "ZAxisMapping"      "5 6"
  EndSection

  You can change button number assignment using the xmodmap command
  AFTER you start the X server with the above configuration.  You may
  not like to use the wheel as the button 2 and rather want the side
  button (button 4) act like the button 2. You may also want to map the
  wheel movement to the button 4 and 5.  This can be done by the
  following command:

          xmodmap -e "pointer = 1 6 3 2 4 5"

  After this command is run, the correspondence between the buttons and
  button numbers will be as shown in the following table.

  Physical Buttons        Reported as:
  ------------------------------------
  1 Left Button             Button 1
  2 Wheel Button            Button 6
  3 Right Button            Button 3
  4 Side Button             Button 2
  5 Wheel Negative Move     Button 4
  6 Wheel Positive Move     Button 5


  Starting in the Xorg 6.9 release, you can also achieve this in your
  configuration file by adding this to the "InputDevice" section in
  xorg.conf:

          Option "ButtonMapping" "1 6 3 2 4 5"

  For the MS IntelliMouse Explorer which as a wheel and 5 buttons, you
  may have the following InputDevice section.

  Section "InputDevice"
          Identifier      "IntelliMouse Explorer"
          Driver          "mouse"
          Option          "Device"    "/dev/mouse"
          Option          "Protocol"  "ExplorerPS/2"
          Option          "Buttons"   "7"
          Option          "ZAxisMapping"      "6 7"
  EndSection

  The IntelliMouse Explorer has 5 buttons, thus, you should give "7" to
  the Buttons option if you want to map the wheel movement to buttons (6
  and 7).  With this configuration, the correspondence between the
  buttons and button numbers will be as follows:

  Physical Buttons        Reported as:
  ------------------------------------
  1 Left Button             Button 1
  2 Wheel Button            Button 2
  3 Right Button            Button 3
  4 Side Button 1           Button 4
  5 Side Button 2           Button 5
  6 Wheel Negative Move     Button 6
  7 Wheel Positive Move     Button 7

  You can change button number assignment using xmodmap AFTER you
  started the X server with the above configuration.

          xmodmap -e "pointer = 1 2 3 4 7 5 6"

  The above command will moves the side button 2 to the button 7 and
  make the wheel movement reported as the button 5 and 6. See the table
  below.

  Physical Buttons        Reported as:
  ------------------------------------
  1 Left Button             Button 1
  2 Wheel Button            Button 2
  3 Right Button            Button 3
  4 Side Button 1           Button 4
  5 Side Button 2           Button 7
  6 Wheel Negative Move     Button 5
  7 Wheel Positive Move     Button 6

  For the A4 Tech WinEasy mouse which has two wheels and 3 buttons, you
  may have the following InputDevice section.

  Section "InputDevice"
          Identifier      "WinEasy"
          Driver          "mouse"
          Option          "Device"    "/dev/mouse"
          Option          "Protocol"  "IMPS/2"
          Option          "Buttons"   "7"
          Option          "ZAxisMapping"      "4 5 6 7"
  EndSection

  The movement of the first wheel is mapped to the button 4 and 5. The
  second wheel's movement will be reported as the buttons 6 and 7.

  The Kensington Expert mouse is really a trackball. It has 4 buttons
  arranged in a rectangle around the ball.

Fuente: ftp://ftp.x.org/pub/current/doc/mouse.txt


Esta es una excelente información. Desafortunadamente, xmodmap -ppno muestra los nombres (por ejemplo, "botón izquierdo", "botón de rueda") para botones físicos según la documentación. Vea mi actualización de la pregunta.
Dave Jarvis el

@DaveJarvis, actualicé mi respuesta. puede ser: / ¡deberíamos esperar a la próxima generación de ratones, inteligentes! o puede no ser necesario un mouse en el futuro. :)
user.dz

¿O una base de datos pública de dispositivos que se pueden consultar para determinar los nombres de sus mapas de botones?
Dave Jarvis el
Al usar nuestro sitio, usted reconoce que ha leído y comprende nuestra Política de Cookies y Política de Privacidad.
Licensed under cc by-sa 3.0 with attribution required.