commandline/xservopointer.c File Reference

Tool that uses a servo to point to the mouse cursor under X. More...

#include <math.h>
#include <time.h>
#include <X11/Xlib.h>
#include <usb.h>
#include "usbdrv.h"

Go to the source code of this file.

Functions

void update ()
 Determines the current cursor position and sets the servo angle.
int main (int argc, char *argv[])
 Main function.

Variables

Display * dpy
Window root
 The display to use.
int rootwidth
 The root-window of the display.
int rootheight
int servoposx
 Measurements of the desktop.
int servoposy
usb_dev_handle * handle = NULL
 Position of the mouse cursor.


Detailed Description

Tool that uses a servo to point to the mouse cursor under X.

Author:
Ronald Schaten
Version:
Id
xservopointer.c,v 1.1 2006/10/28 12:40:42 rschaten Exp
License: See documentation.

Definition in file xservopointer.c.


Function Documentation

int main ( int  argc,
char *  argv[] 
)

Main function.

Initializes the X-settings and the USB-device, starts the timer and calls the update-function.

Parameters:
argc Number of arguments.
argv Arguments.
Returns:
Error code.

Definition at line 68 of file xservopointer.c.

References dpy, handle, root, rootheight, rootwidth, servoposx, servoposy, update(), USBDEV_SHARED_PRODUCT, USBDEV_SHARED_VENDOR, and usbOpenDevice().

void update (  ) 

Determines the current cursor position and sets the servo angle.

Definition at line 30 of file xservopointer.c.

References CMD_SET, dpy, handle, root, servoposx, and servoposy.

Referenced by main().


Variable Documentation

Display* dpy

Definition at line 19 of file xservopointer.c.

Referenced by main(), and update().

usb_dev_handle* handle = NULL

Position of the mouse cursor.

Definition at line 25 of file xservopointer.c.

Referenced by main(), update(), and usbOpenDevice().

Window root

The display to use.

Definition at line 20 of file xservopointer.c.

Referenced by main(), and update().

int rootheight

Definition at line 22 of file xservopointer.c.

Referenced by main().

int rootwidth

The root-window of the display.

Definition at line 22 of file xservopointer.c.

Referenced by main().

int servoposx

Measurements of the desktop.

Definition at line 23 of file xservopointer.c.

Referenced by main(), and update().

int servoposy

Definition at line 23 of file xservopointer.c.

Referenced by main(), and update().


Generated on Sat Oct 28 14:48:23 2006 for USB-Servo by  doxygen 1.4.7