ubuntu:mouse:mapping_mouse_buttons_to_arbitrary_functions
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
ubuntu:mouse:mapping_mouse_buttons_to_arbitrary_functions [2021/10/25 14:54] – peter | ubuntu:mouse:mapping_mouse_buttons_to_arbitrary_functions [2021/10/25 19:49] (current) – removed peter | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Ubuntu - Mouse - Mapping Mouse Buttons to Arbitrary Functions ====== | ||
- | |||
- | ===== Install xbindkeys ===== | ||
- | |||
- | <code bash> | ||
- | sudo apt install xbindkeys | ||
- | </ | ||
- | |||
- | ---- | ||
- | |||
- | ===== Install xautomation ===== | ||
- | |||
- | <code bash> | ||
- | sudo apt install xautomation | ||
- | </ | ||
- | |||
- | <WRAP info> | ||
- | **NOTE:** This provides the **xte** component; to send events directly to the input handler. | ||
- | |||
- | * These events include Button presses and Mouse clicks. | ||
- | </ | ||
- | |||
- | |||
- | ---- | ||
- | |||
- | ===== Create the xbindkeys Configuration File ===== | ||
- | |||
- | <code bash?> | ||
- | xbindkeys --defaults > $HOME/ | ||
- | </ | ||
- | |||
- | ---- | ||
- | |||
- | ===== Edit the xbindkeys Configuration File ===== | ||
- | |||
- | Edit **~/ | ||
- | |||
- | * To create a double-click event when button 8 is released, add the following: | ||
- | |||
- | <file bash ~/ | ||
- | "/ | ||
- | b:8 + Release | ||
- | </ | ||
- | |||
- | <WRAP info> | ||
- | **NOTE: | ||
- | |||
- | * The first line is a command to be executed for an event; | ||
- | * The quotation marks ("" | ||
- | * The second line is the event description. | ||
- | |||
- | * The first mouse button (left) is called b:1, the second (right) b:2 and so forth. | ||
- | |||
- | Here, the **xte** component of xautomation to send events directly to the input handler. | ||
- | </ | ||
- | |||
- | ---- | ||
- | |||
- | ===== Additional xbindkeys Configurations ===== | ||
- | |||
- | Here are some examples of additional entries. | ||
- | |||
- | <file bash ~/ | ||
- | # Back changed to Copy | ||
- | "xte ' | ||
- | b:8 | ||
- | |||
- | # Forward | ||
- | "xte ' | ||
- | b:9 | ||
- | </ | ||
- | |||
- | <WRAP info> | ||
- | **NOTE: | ||
- | |||
- | * Back button: 8 | ||
- | * When Button 8 on the mouse is pressed, send a CTRL-C followed by a Key up. | ||
- | |||
- | * Forward button: 9 | ||
- | * When Button 9 on the mouse is pressed, send a ALT followed by a Key up. | ||
- | |||
- | </ | ||
- | |||
- | ---- | ||
- | |||
- | ====== Run at startup ====== | ||
- | |||
- | One approach is to create a shell script that performs the Mouse Button mapping: | ||
- | |||
- | <code bash> | ||
- | echo " | ||
- | </ | ||
- | |||
- | Give it executable permission: | ||
- | |||
- | <code bash> | ||
- | chmod +x leftmouseremap.sh | ||
- | </ | ||
- | |||
- | <WRAP info> | ||
- | **NOTE: | ||
- | |||
- | * Follow any process to have this script run at boot if needed. | ||
- | |||
- | * Remember to configure ' | ||
- | * '/ | ||
- | |||
- | </ | ||
- | |||
- | |||
- | ---- | ||
- | |||
- | ====== References ====== | ||
- | |||
- | https:// | ||
ubuntu/mouse/mapping_mouse_buttons_to_arbitrary_functions.1635173653.txt.gz · Last modified: 2021/10/25 14:54 by peter