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

PrintScreen (Print Screen)
ScrollLock (Scroll Lock)
Pause (Pause/Break)
Escape (escape)
Backspace ⌫
Delete ⌦
Shift (modify the next character)
Ctrl (modify the next character)
Alt (modify the next character)
Meta (modify the next character)
keysym is X11's key syntax. (e.g. \[Left]) [see Linux: X11 Keyboard Key Names]
Mouse left click
Mouse middle click
Mouse right click
Mouse 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.