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
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

\[F1]
F1
\[F2]
F2
\[Print]
PrintScreen (Print Screen)
\[Scroll_Lock]
ScrollLock (Scroll Lock)
\[Pause/Break]
Pause (Pause/Break)
\r
Return
\t
Tab
\e
Escape (escape)
\b
Backspace ⌫
\d
Delete ⌦
\S
Shift (modify the next character)
\C
Ctrl (modify the next character)
\A
Alt (modify the next character)
\M
Meta (modify the next character)
\[keysym]
keysym is X11's key syntax. (For example, \[Left]) [see Linux: X11 Keyboard Key Names]
\m1
Mouse left click
\m2
Mouse middle click
\m3
Mouse right click
\mdigit
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.

See:

Linux Keybinding Howto

Mouse

Linux Desktop keys