From imattsson@common-lisp.net Wed Dec 27 11:30:00 2006 From: Ingvar Mattsson To: gamelib-cvs@common-lisp.net Subject: [gamelib-cvs] stick.html Date: Wed, 27 Dec 2006 16:29:59 +0000 Message-ID: <20061227162959.75EC425002@common-lisp.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3710808768049167037==" --===============3710808768049167037== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Update of /project/gamelib/cvsroot/source/doc In directory clnet:/tmp/cvs-serv968/doc Added Files: stick.html Log Message: IM Initial check-in --- NEW FILE: stick.html --- Gamelib - games-3d library

Gamelib

The joystick library

Introduction

Having the use of a joystick enhances the sensation of presence in a game. Under linux, the available joystick API is based around periodic reading of events from a device driver file (usually /dev/jsX or /dev/input/jsX).

Gamelib now offers an interface to handle joysticks on the linux platform (code for joystick handling on other platforms is welcome). The joystick is somewhat abstracted from the raw data that the device driver offers.

API

The interface is centred around a JOYSTICK object (created by calling MAKE-STICK with a suitable device name as argument). To read an event from the device driver, call UPDATE-STICK with the joystick object as argument.

Under SBCL (with thread support) there is a "continous poll" support (simply call CONTINOUS-POLL with the joystick object as argument, to terminate the polling thread, call TERMINATE-POLL with the object as argument). All relevant locking is done, keyed on if a joystick is polled or not

There are two arrays that are of interest in a joystick object js. The first is the analog axes, (axes js) and the second is the buttons (buttons js). The library currently supports up to 8 analog axes and up to 24 buttons (and will most likely crash in amusing ways, should these limits be too strict).

--===============3710808768049167037==--