Please note - Ndiyo has now officially closed its doors, at least as a legal entity - but we've kept the site alive in case any of the information is useful to others.

Our thanks to all those who helped out and were involved in so many different ways! The Ndiyo legacy lives on in the ultra-thin-client work at its spin-off DisplayLink, at Plugable, at NoPC and elsewhere...

ev2vnc

A program to send low-level Linux keyboard and pointer events to a VNC server

Recent Linux distributions use the udev system to cluster input devices such as keyboards and mice into a consistent arrangement where they appear as devices named, for example, /dev/input/event2, regardless of whether they're connected via a PS/2 port, a USB hub, or some other way.

Often, a linux machine will be configured so that events from all such local peripherals come in to the one, main X server. But it doesn't have to be that way.

Ev2vnc lets you take events from, say, a second USB mouse, and forward them to a VNC session, running on the local machine or somewhere else.

If you're familar with the 'x2vnc' package, this does something similar but without requiring the events to go through a local X server.

For reasons why you might want to do this, have a look at the Ndiyo 'Hubster' project.

A typical use would be:

    ev2vnc -input /dev/input/event2 rupert:1

The program will work out whether the input device is a keyboard or a pointer (mouse) and will send the appropriate events to the VNC session specified - VNC display :1 on machine 'rupert' in the above example. If you have both a keyboard and a mouse you probably want to run two instances of ev2vnc - one for each.

One way to identify the different event devices is to look at the output of the lshal command - in particular look for the lines containing 'input.device'.

If you're using devices in this way, you probably want to prevent them from also sending events to your local X server. Typically this happens because the file /etc/X11/xorg.conf refers to a generic catch-all device like /dev/input/mice. If you make this refer more specifically to a particular mouse, such as /dev/input/event1, then you can freely use devices like /dev/input/event2 for other things.

Event devices may have permissions set which prevent them from being read by ordinary users. In that case you'll either have to run as root or using 'sudo', or change the permissions using the udev system - see 'man udev'.

The program was put together very quickly and has many imperfections. At the time of writing it doesn't handle Caps Lock properly, for example, and your mileage may vary widely if you're using an international keyboard. But it should be pretty easy to patch, and contributions are most welcome!

Ev2vnc is essentially a cut-down modification of the vncviewer software from the good folks at RealVNC, and is therefore distributed under the terms of the GPL.

Getting ev2vnc

The ev2vnc project is hosted on Sourceforge, and the source can be downloaded from the Subversion repository there. For further information, documentation etc please visit the project page.

Quentin Stafford-Fraser, Copyright (c) 2006 Ndiyo Ltd