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!
········@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/
········@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
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.