Writing the man page is not covered in this tutorial.īy the way, now's a good time to init your git repository.
Our source files random.h and random.c will become our driver implementation. These macros provide the DRIVER_MAN_SUFFIX variable and the PACKAGE_VERSION_* variables amongst others.
#OS X SERVER DOCUMENTATION INSTALL#
If you are compiling input drivers without the full X source tree, instead using your distribution's development libraries, you may need to install the xorg-util-macros to get the automake scripts to work properly. The evdev driver would be a good source for this, as it is very actively maintained. We don't want to write the automake files from scratch, so we copy them from some other driver, and replace all occurances of the other driver's name with our name. Our initial directory tree should look like this: xf86-input-random/COPYING We set the directory up, and provide the minimum amount of files. The naming convention for input drivers is xf86-input-devicename.
#OS X SERVER DOCUMENTATION HOW TO#
This document was originally written by Peter Hutterer to have a tutorial that'll teach him how to write an input driver. It is recommended that you put your own driver into a git repository, especially if you want to bundle it with the X server distributions. It is a good idea to familiarise yourself with git when you start developing a new driver. The X server and most of the drivers are kept in git. The full source is available from git:///~whot/xf86-input-random. All this driver will do is randomly move the cursor along the x axis. Its job is to introduce you to the way how drivers are written, not to provide an actual driver for your device. This tutorial will explain the “random” driver for a pointing device that feeds from /dev/random. This tutorial is for those seeking to understand input drivers, or having special devices that cannot be used through the kernel's evdev interface. Time is much better spent writing a kernel driver instead, and then your device will be picked up automatically via evdev. touchscreen, mouse, keyboard, etc.), please don't. Note that if you think about writing a new input driver for a “common” device (e.g. If you're planning to invent a new device, you will most likely also need a matching driver for the linux kernel. Warning: This tutorial is outdated and refers to APIs that have since been changed. Knowledge of C is a prerequisite, experience with X server development is handy but not required. This is a tutorial to write a new input driver for X.