From: Yue Wang
Subject: How to get data from joystick
Date: 
Message-ID: <b9bcd155.0105220811.3293d85f@posting.google.com>
Hi, all

I need to build an application with Common lisp to get the data (user
response, especially the direction they pull the handle) from
joystick. But I have no idea about how to get the data using lisp.
Anyone here knows about the programming interface of joystick? Thanks
a lot!

From: Martin Cracauer
Subject: Re: How to get data from joystick
Date: 
Message-ID: <9efl6h$21j3$1@counter.bik-gmbh.de>
········@uth.tmc.edu (Yue Wang) writes:

>I need to build an application with Common lisp to get the data (user
>response, especially the direction they pull the handle) from
>joystick. But I have no idea about how to get the data using lisp.
>Anyone here knows about the programming interface of joystick? Thanks
>a lot!

Open /dev/js0 and read items of 'struct js_event' from it.

Martin
-- 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Martin Cracauer <········@bik-gmbh.de> http://www.bik-gmbh.de/~cracauer/
FreeBSD - where you want to go. Today. http://www.freebsd.org/
From: Lars Bjønnes
Subject: Re: How to get data from joystick
Date: 
Message-ID: <m3d790qh46.fsf@siteloft.com>
········@counter.bik-gmbh.de (Martin Cracauer) writes:

> ········@uth.tmc.edu (Yue Wang) writes:
> 
> >I need to build an application with Common lisp to get the data (user
> >response, especially the direction they pull the handle) from
> >joystick. But I have no idea about how to get the data using lisp.
> >Anyone here knows about the programming interface of joystick? Thanks
> >a lot!
> 
> Open /dev/js0 and read items of 'struct js_event' from it.

I did this a couple of years ago, and had some problems (probably my
fault :-) reading the /dev/js0 directly from ACL. What I did was to
make a small shared library in C, using the joystick drivers, reading
the /dev/js0. The library provided a few functions (read the current
state of the x, y, and z-axis etc.)  that ACL could interface against
using FFI. 

I don't think I still got the code, but I'll check.

-- 
Lars
From: Yue Wang
Subject: Re: How to get data from joystick
Date: 
Message-ID: <b9bcd155.0105231005.7dfec32@posting.google.com>
It is my fault that I did not state my problem clearly.  Actually I am
developing the application using Macintosh Common Lisp.  I don't know
if there will be the same about the joystick interface over Mac or
Windows.  Anyway, if someone knows about this or even have source
code, I appreciate your input.

Thanks a lot!
Yue

Lars Bj�nnes <············@fredrikstad.online.no> wrote in message news:<··············@siteloft.com>...
> ········@counter.bik-gmbh.de (Martin Cracauer) writes:
> 
> > ········@uth.tmc.edu (Yue Wang) writes:
> > 
> > >I need to build an application with Common lisp to get the data (user
> > >response, especially the direction they pull the handle) from
> > >joystick. But I have no idea about how to get the data using lisp.
> > >Anyone here knows about the programming interface of joystick? Thanks
> > >a lot!
> > 
> > Open /dev/js0 and read items of 'struct js_event' from it.
> 
> I did this a couple of years ago, and had some problems (probably my
> fault :-) reading the /dev/js0 directly from ACL. What I did was to
> make a small shared library in C, using the joystick drivers, reading
> the /dev/js0. The library provided a few functions (read the current
> state of the x, y, and z-axis etc.)  that ACL could interface against
> using FFI. 
> 
> I don't think I still got the code, but I'll check.