User Tools

Site Tools


ubuntu:mouse:map_mouse_buttons_to_arbitrary_functions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
ubuntu:mouse:map_mouse_buttons_to_arbitrary_functions [2021/10/25 23:35] – [Run at startup] peterubuntu: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:Mouse:Map Mouse Buttons to Arbitrary Functions:|Map Mouse Buttons to Arbitrary Functions]] 
  
 ---- ----
Line 58: Line 54:
 **NOTE:**  The format of this file is a series of paired lines. **NOTE:**  The format of this file is a series of paired lines.
  
-  The first line is a command to be executed for an event;+  The first line is a command to be executed for an event;
     * The quotation marks ("") around the command is required.     * The quotation marks ("") around the command is required.
-  The second line is the associated mouse button.+  The second line is the associated mouse button.
     * 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.
 </WRAP> </WRAP>
Line 79: Line 75:
 <WRAP info> <WRAP info>
 **NOTE:**  This binds __button 6__ to the __home__ key **NOTE:**  This binds __button 6__ to the __home__ key
 +
 +  * Raw keycodes can be used too, for example: <code>
 +"xte 'keydown Home' 'keyup Home'"
 +m:0x0 + b:6 
 +</code>
 +
 +See: [[Ubuntu:Mouse:Map Mouse Buttons to Arbitrary Functions:Identify the key codes to use|Identify the key codes to use]]
 +
 +</WRAP>
 +
 +----
 +
 +==== Another examples ====
 +
 +<file bash ~/.xbindkeysrc>
 +# Refresh
 +"xte 'key F5'"
 +  b:4 + control
 +</file>
 +
 +<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.
 +
 </WRAP> </WRAP>
  
Line 107: Line 129:
 ==== More complex examples ==== ==== More complex examples ====
  
 +<file bash ~/.xbindkeysrc>
 "/usr/bin/xte 'mouseclick 1' 'mouseclick 1' &" "/usr/bin/xte 'mouseclick 1' 'mouseclick 1' &"
 b:8 + Release b:8 + Release
Line 112: Line 135:
  
 <WRAP info> <WRAP info>
-**NOTE:**  This maps a double-left-click to button 8,+**NOTE:**  This maps a double-left-click to button 8.
  
   * 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 ======
  
 +If any changes are made to the config file then xbindkeys needs to be restarted:
 +
 +<code bash>
 +killall xbindkeys
 +xbindkeys
 +</code>
 +
 +
 +
 +----
  
 ====== References ====== ====== References ======
  
 https://linux.die.net/man/7/xautomation https://linux.die.net/man/7/xautomation
 +
 +https://manpages.debian.org/stretch/xautomation/xte.1
 +
 +https://linux.die.net/man/1/xte
 +
  
ubuntu/mouse/map_mouse_buttons_to_arbitrary_functions.1635204926.txt.gz · Last modified: 2021/10/25 23:35 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki