Linux: xvkbd tutorial

By Xah Lee. Date: .

xvkbd is command line tool that lets you send a keyboard key signal or mouse click.

linux x11 virtual keyboard xvkbd

Install xvkbd

# install xvkbd
sudo apt-get install xvkbd

xvkbd Command Example

# this command sends the key control+c
xvkbd -no-jump-pointer -xsendevent -text '\Cc'
# this command sends mouse left click
xvkbd -no-jump-pointer -xsendevent -text '\m1'

xvkbd key syntax

xvkbd key syntax
\[Print]Print Screen (Print Screen)
\[Scroll_Lock]Scroll Lock (Scroll Lock)
\[Pause/Break]Pause (Pause/Break)
\eEscape (escape)
\b⌫ Backspace
\d⌦ Delete
\SShift (modify the next character)
\CCtrl (modify the next character)
\AAlt (modify the next character)
\MMeta (modify the next character)
\[keysym]keysym is X11's key syntax. (For example, \[Left]) [see Linux: X11 Keyboard Key Names]
\m1mouse left click
\m2mouse middle click
\m3mouse right click
\mdigitmouse click of the specified mouse button. [see Linux: X11 Mouse Button Numbering]

[see Linux: X11 Keyboard Key Names]

Bind Keys to Command

For xvkbd to be useful, you need to bind keys to command.

For example, make F2 do Ctrl+c.


Linux Keybinding How-to

  1. Keyboard Software Guide
  2. Swap Control Alt Keys
  3. Set F2 F3 F4 to Cut Copy Paste
  4. CapsLock → Escape
  5. CapsLock → Home
  6. Shift Lock
  7. Key to Switch App
  8. Key Repeat Rate
  9. System Keyboard Layout
  10. Switch Keyboard Layout
  11. Change Volume
  12. xmodmap
  13. xbindkeys
  14. xvkbd
  15. Find Keyboard Key Scancode
  16. X11 Keyboard Key Names
  17. 2 Layouts for 2 Keyboards
  18. Chinese Input Setup


  1. Mouse Hover to Auto-Raise Window
  2. Mouse Hover-Click
  3. Set Mouse Single-Click to Open File
  4. How to Set Mouse Speed
  5. How to Swap Mouse Buttons
  6. Set Trackball/Mouse Do Scroll
  7. Setup Accelerated Scroll and AutoScroll
  8. X11 Mouse Button Numbering

If you have a question, put $5 at patreon and message me.