LCDproc development and user support list

Text archives Help


[Lcdproc] example menu?


Chronological Thread 
  • From: kripton AT kripserver.net (Jannis Achstetter)
  • Subject: [Lcdproc] example menu?
  • Date: Thu Jul 6 18:13:02 2006

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jannis Achstetter schrieb:
> Peter Marschall schrieb:
>>> Hi Jannis,
>>>
>>> On Tuesday, 27. June 2006 19:57, Jannis Achstetter wrote:
>>>> Is there any way right now to use a joystick to control the
>>>> menu? I know there's some kind of "joystick-driver" but I
>>>> can't get it to work. Is it because of an API-breakage of
>>>> 0.5.0/CVS or is it my
> fault?
>>>> Any easy way to fix it?
>>> It might be that the update of the API to 0.5 broke the joy
>>> driver. I did that update from the old 0.4.x API, that is not
>>> compatible with the 0.5 API, without owning a joystick.
>>>
>>> With a sufficiently high report level ( 5) the driver should
>>> tell which features it detected on the joystick and how it
>>> interprets the
> mapping.
>>> of the axes (is this the plural of axis?) and buttons.
>>>
>>> Hope it helps Peter
>>>
> Tried it, here's the result:
>
> driver_load( name="joy",
> filename="/usr/share/lcdproc/drivers/joy.so") joy: using Device
> /dev/input/js0 joy: Joystick (Analog 2-axis 4-button joystick) has
> 2 axes and 4 buttons. Driver version is 2.1.0 joy: init() done Key
> "Escape" is now reserved in exclusive mode by client [-1] Key
> "Enter" is now reserved in shared mode by client [-1] Key "Up" is
> now reserved in shared mode by client [-1] Key "Down" is now
> reserved in shared mode by client [-1]
>
>
> That's basically it, when I move the joystick or press a key,
> nothing happens. When I quit the server, it says:
>
> Key "Escape" was reserved in exclusive mode by client [-1] and is
> now released Key "Enter" was reserved in shared mode by client [-1]
> and is now released Key "Up" was reserved in shared mode by client
> [-1] and is now released Key "Down" was reserved in shared mode by
> client [-1] and is now released
>
> Any Ideas?
>
> Jannis
>
OK, (GOOD) NEWS:
I forgot some lines in the config-file:

# set the axis map
Map_Axis1neg=Up
Map_Axis1pos=Down
# set the button map
Map_Button1=Enter
Map_Button2=Escape

and then the buttons worked, the axis didn't. I digged into the code
and found:
if ((js.value > -20000) || (js.value < 20000) || (js.number >= 2 *
p->axes)) {
return NULL;
}
which doesn't make much sense (because it's always true (greater than
- -20000 and smaller than 20000).
I fixed it to:
if (((js.value > -20000) && (js.value < 20000)) || (js.number >= 2 *
p->axes)) {
return NULL;
}

and now the axis work. I don't know wether it has been fixed in CVS (I
used 0.5.0) but if not please fix it (file server/drivers/joy.c)

Greetings,
Jannis Achstetter
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFErVC4eYlewm37lbgRAjwKAJoCSKtXgyn522HJl7UH9qztIccpFQCdE1zf
fKvdz8JL1uOYuvlRax3GNRo=
=qgzJ
-----END PGP SIGNATURE-----





Archive powered by MHonArc 2.6.18.

Top of page