ubuntu:mouse:determine_the_mouse_button_numbers
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
ubuntu:mouse:determine_the_mouse_button_numbers [2021/10/25 08:44] – created peter | ubuntu:mouse:determine_the_mouse_button_numbers [2021/10/25 11:18] (current) – [Another Way to Determine the Mouse Buttons] peter | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Ubuntu - Mouse - Determine the Mouse Button Numbers ====== | ====== Ubuntu - Mouse - Determine the Mouse Button Numbers ====== | ||
- | Each button on the mouse should have a Unique number associated with it, | + | Each button on the mouse should have a Unique number associated with it. |
This Button Number can be used to configure a specific button. | This Button Number can be used to configure a specific button. | ||
Line 7: | Line 7: | ||
---- | ---- | ||
+ | ===== Determine the Mouse to use ===== | ||
+ | <code bash> | ||
+ | xinput | grep -m 1 " | ||
+ | </ | ||
+ | |||
+ | returns: <code bash> | ||
+ | 8 | ||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | |||
+ | * This shows that the id of the mouse is 8 in this case. | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Get Button Map ===== | ||
+ | |||
+ | <code bash> | ||
+ | xinput get-button-map 8 | ||
+ | </ | ||
+ | |||
+ | returns: | ||
+ | |||
+ | <code bash> | ||
+ | 1 2 3 4 5 6 7 8 9 | ||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | |||
+ | * The result shows that the mouse has 9 buttons. | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Determine Which Mouse Button is Which ===== | ||
+ | |||
+ | <code bash> | ||
+ | xinput test | ||
+ | </ | ||
+ | |||
+ | returns: | ||
+ | |||
+ | <code bash> | ||
+ | ... | ||
+ | button press | ||
+ | button release 1 | ||
+ | ... | ||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | |||
+ | * In this case, the result shows **button press 1** when the left mouse button on the mouse was pressed. | ||
+ | * Determine the Button Number for every button. | ||
+ | |||
+ | * Usually left mouse button is shown as **button 1**. | ||
+ | * Usually middle mouse button is shown as **button 2**. | ||
+ | * Usually right mouse button is shown as **button 3**. | ||
+ | * Other buttons can be determined through trial and error. | ||
+ | * The scroll wheel on the mouse (both forwards and backward scrolls) also have a unique button id. | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Another Way to Determine the Mouse Buttons ===== | ||
+ | |||
+ | <code bash> | ||
+ | xev | grep button | ||
+ | |||
+ | or | ||
+ | |||
+ | xev | ||
+ | </ | ||
+ | |||
+ | displays: | ||
+ | |||
+ | {{: | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE:** Move the mouse cursor within the boxes and the xev will display many lines of data relating to mouse movements and button presses. | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Identify Each Button Number ==== | ||
+ | |||
+ | With **xev** running, move the mouse pointer into the xev display and click each button on the mouse. | ||
+ | |||
+ | <code bash> | ||
+ | ButtonPress event, serial 37, synthetic NO, window 0x6200001, | ||
+ | root 0x1e4, subw 0x0, time 2473474233, (151,31), root: | ||
+ | state 0x0, button 1, same_screen YES | ||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | |||
+ | * In this case, the bottom line of the result shows **button 1** when the left mouse button on the mouse was pressed. | ||
+ | * Determine the Button Number for every button. | ||
+ | |||
+ | * Usually left mouse button is shown as **button 1**. | ||
+ | * Usually middle mouse button is shown as **button 2**. | ||
+ | * Usually right mouse button is shown as **button 3**. | ||
+ | * Other buttons can be determined through trial and error. | ||
+ | * The scroll wheel on the mouse (both forwards and backward scrolls) also have a unique button id. | ||
+ | |||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== References ===== | ||
+ | |||
+ | http:// |
ubuntu/mouse/determine_the_mouse_button_numbers.1635151496.txt.gz · Last modified: 2021/10/25 08:44 by peter