Virtual typing using evdev
  • Rust 76.3%
  • Nix 23.7%
Find a file
2020-03-21 13:55:28 +01:00
src dont error hard on invalid utf8 input 2020-03-21 13:27:06 +01:00
.gitignore init repo 2020-03-20 18:49:07 +01:00
Cargo.lock remove unused dependencies 2020-03-20 23:43:32 +01:00
Cargo.toml remove unused dependencies 2020-03-20 23:43:32 +01:00
evtype.service add systemd service 2020-03-20 23:30:37 +01:00
README.md extend readme 2020-03-21 13:55:28 +01:00

EvType

Virtual typing using evdev.

What

EvType is made to replace the xdotool type command for wayland systems, where there is no option for virtual keyboard input.

Usage

  • Start the evtype_daemon as root using your favorite init daemon (a systemd unit is included).
  • Run evtype <text> to enter some text trough the virtual keyboard.

Why a separate daemon

For security reasons your user generally doesn't have permissions to talk directly to evdev so root permissions are required. By having a separate daemon do the talking to evdev the evtype tool doesn't need to be run as root and only a restricted api is exposed to non-root users (i.e. only typing printable characters, no keyboard logging).

Limitations

EvType currently always assumes query layout and might result in unexpected results when the system is configured with a different keyboard layout.

Programmatic usage

You can use the evtype_daemon from your own programs by connecting to the unix socket at /var/run/evtype.sock and send the text to be typed over the socket.

A basic rust example:

use std::io::Write;
use std::os::unix::net::UnixStream;

fn main -> Result<(), Box<dyn Error>> {
    let mut stream = UnixStream::connect("/var/run/evtype.sock")?;
    stream.write_all("hello world".as_bytes())?;
    Ok(());
}