ubuntu:mouse:map_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:map_mouse_buttons_to_arbitrary_functions [2021/10/25 23:33] – [Assign a function to a Mouse Button] peter | ubuntu:mouse:map_mouse_buttons_to_arbitrary_functions [2021/10/26 08:57] (current) – peter | ||
---|---|---|---|
Line 9: | Line 9: | ||
* **xvkbd** can send a keyboard key signal or mouse click to other programs. | * **xvkbd** can send a keyboard key signal or mouse click to other programs. | ||
* **xdotool** can simulate keyboard input and mouse activity, move and resize windows, etc. | * **xdotool** can simulate keyboard input and mouse activity, move and resize windows, etc. | ||
- | |||
- | ---- | ||
- | |||
- | [[Ubuntu: | ||
---- | ---- | ||
Line 58: | Line 54: | ||
**NOTE: | **NOTE: | ||
- | | + | |
* The quotation marks ("" | * The quotation marks ("" | ||
- | | + | |
* The first mouse button (left) is called b:1, the second b:2 and so forth. | * The first mouse button (left) is called b:1, the second b:2 and so forth. | ||
</ | </ | ||
Line 79: | Line 75: | ||
<WRAP info> | <WRAP info> | ||
**NOTE: | **NOTE: | ||
+ | |||
+ | * Raw keycodes can be used too, for example: < | ||
+ | "xte ' | ||
+ | m:0x0 + b:6 | ||
+ | </ | ||
+ | |||
+ | See: [[Ubuntu: | ||
+ | |||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Another examples ==== | ||
+ | |||
+ | <file bash ~/ | ||
+ | # Refresh | ||
+ | "xte 'key F5'" | ||
+ | b:4 + control | ||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE:** This maps: | ||
+ | |||
+ | * This will cause the forward mouse button and the CTRL key to emulate pressing the F5 key. | ||
+ | * This is useful for refreshing a web page without moving your hand off the mouse. | ||
+ | |||
</ | </ | ||
Line 107: | Line 129: | ||
==== More complex examples ==== | ==== More complex examples ==== | ||
+ | <file bash ~/ | ||
"/ | "/ | ||
b:8 + Release | b:8 + Release | ||
Line 112: | Line 135: | ||
<WRAP info> | <WRAP info> | ||
- | **NOTE: | + | **NOTE: |
* The **Release** option catches __release__ events instead of __press__ events. | * The **Release** option catches __release__ events instead of __press__ events. | ||
Line 120: | Line 143: | ||
---- | ---- | ||
+ | ====== Restart xbindkeys ====== | ||
- | ====== Run at startup ====== | + | If any changes are made to the config file then xbindkeys needs to be restarted: |
- | + | ||
- | One approach is to create a shell script that performs | + | |
<code bash> | <code bash> | ||
- | echo " | + | killall xbindkeys |
+ | xbindkeys | ||
</ | </ | ||
- | 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. | + | ====== References ====== |
- | * Remember to configure ' | + | https://linux.die.net/man/ |
- | * '/usr/bin/xbindkeys' | + | |
- | </WRAP> | + | https:// |
+ | https:// | ||
- | ---- | ||
- | |||
- | ====== References ====== | ||
- | |||
- | https:// | ||
ubuntu/mouse/map_mouse_buttons_to_arbitrary_functions.1635204808.txt.gz · Last modified: 2021/10/25 23:33 by peter