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:29] – 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: | ||
+ | |||
</ | </ | ||
- | Other example: | + | ---- |
+ | |||
+ | ==== 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. | ||
+ | |||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Other examples ==== | ||
<file bash ~/ | <file bash ~/ | ||
Line 94: | Line 118: | ||
<WRAP info> | <WRAP info> | ||
- | **NOTE: | + | **NOTE: |
* Button 8 is mapped to ALT+LEFT. | * Button 8 is mapped to ALT+LEFT. | ||
Line 101: | Line 125: | ||
</ | </ | ||
+ | ---- | ||
- | More complex examples: | + | ==== More complex examples |
+ | <file bash ~/ | ||
"/ | "/ | ||
b:8 + Release | b:8 + Release | ||
Line 109: | 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 117: | Line 143: | ||
---- | ---- | ||
- | ===== Additional | + | ====== Restart |
- | Here are some examples of additional entries. | + | If any changes |
- | + | ||
- | <file bash ~/ | + | |
- | # Back changed | + | |
- | "xte ' | + | |
- | b:8 | + | |
- | + | ||
- | # Forward | + | |
- | "xte ' | + | |
- | b:9 | + | |
- | </file> | + | |
- | + | ||
- | <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> | <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.1635204572.txt.gz · Last modified: 2021/10/25 23:29 by peter