mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* joystick.c
@ 2002-07-09 10:21 Piotr Sawuk
  2002-07-09 16:17 ` joystick.c Thunder from the hill
  2002-07-09 16:38 ` joystick.c Vojtech Pavlik
  0 siblings, 2 replies; 4+ messages in thread
From: Piotr Sawuk @ 2002-07-09 10:21 UTC (permalink / raw)
  To: linux-kernel; +Cc: vojtech

Sorry if I'm off-topic here, since I don't read this list.
also when replying please send me a copy...

in function js_correct(value,corr) I've found the instructions:

if (value < -32767) return -32767;
if (value > 32767) return 32767;

what's the use of these? I'm asking because my new usb-joystick
is returning those values somewhere in the middle of it's threshold
and I was wondering if disabling the above would do any good?


however, the actual reason why I've looked into that file was
because wine reported strange joystick-events 6,7,8,9 and I
just can't figure out what those are supposed to do. I've found
JS_EVENT 1 and 2 in the linux/joystick.h include, but no mention
of anything related to the number '6'. does anyone know anything
about those joystick events?

P

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: joystick.c
  2002-07-09 10:21 joystick.c Piotr Sawuk
@ 2002-07-09 16:17 ` Thunder from the hill
  2002-07-09 16:38 ` joystick.c Vojtech Pavlik
  1 sibling, 0 replies; 4+ messages in thread
From: Thunder from the hill @ 2002-07-09 16:17 UTC (permalink / raw)
  To: Piotr Sawuk; +Cc: linux-kernel, vojtech

Hi,

On Tue, 9 Jul 2002, Piotr Sawuk wrote:
> if (value < -32767) return -32767;
> if (value > 32767) return 32767;
> 
> what's the use of these? I'm asking because my new usb-joystick
> is returning those values somewhere in the middle of it's threshold
> and I was wondering if disabling the above would do any good?

That's just:
We don't return values below -32,767
We don't return values above 32,767

So your values are OK as long as they don't exceed [-32,767:32,767]

							Regards,
							Thunder
-- 
(Use http://www.ebb.org/ungeek if you can't decode)
------BEGIN GEEK CODE BLOCK------
Version: 3.12
GCS/E/G/S/AT d- s++:-- a? C++$ ULAVHI++++$ P++$ L++++(+++++)$ E W-$
N--- o?  K? w-- O- M V$ PS+ PE- Y- PGP+ t+ 5+ X+ R- !tv b++ DI? !D G
e++++ h* r--- y- 
------END GEEK CODE BLOCK------


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: joystick.c
  2002-07-09 10:21 joystick.c Piotr Sawuk
  2002-07-09 16:17 ` joystick.c Thunder from the hill
@ 2002-07-09 16:38 ` Vojtech Pavlik
  2002-07-12  5:00   ` joystick.c Piotr Sawuk
  1 sibling, 1 reply; 4+ messages in thread
From: Vojtech Pavlik @ 2002-07-09 16:38 UTC (permalink / raw)
  To: Piotr Sawuk; +Cc: linux-kernel, vojtech

On Tue, Jul 09, 2002 at 10:21:44AM +0000, Piotr Sawuk wrote:

> Sorry if I'm off-topic here, since I don't read this list.
> also when replying please send me a copy...
> 
> in function js_correct(value,corr) I've found the instructions:
> 
> if (value < -32767) return -32767;
> if (value > 32767) return 32767;
> 
> what's the use of these? I'm asking because my new usb-joystick
> is returning those values somewhere in the middle of it's threshold
> and I was wondering if disabling the above would do any good?

The data coming from the joystick is defined to be bound by this range.
It's signed 16 bit anyway.

> however, the actual reason why I've looked into that file was
> because wine reported strange joystick-events 6,7,8,9 and I
> just can't figure out what those are supposed to do. I've found
> JS_EVENT 1 and 2 in the linux/joystick.h include, but no mention
> of anything related to the number '6'. does anyone know anything
> about those joystick events?

What joystick is it? This looks like a problem with the HID driver.

-- 
Vojtech Pavlik
SuSE Labs

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: joystick.c
  2002-07-09 16:38 ` joystick.c Vojtech Pavlik
@ 2002-07-12  5:00   ` Piotr Sawuk
  0 siblings, 0 replies; 4+ messages in thread
From: Piotr Sawuk @ 2002-07-12  5:00 UTC (permalink / raw)
  To: Vojtech Pavlik; +Cc: linux-kernel

Vojtech Pavlik wrote:
> 
> On Tue, Jul 09, 2002 at 10:21:44AM +0000, Piotr Sawuk wrote:
> 
> > Sorry if I'm off-topic here, since I don't read this list.
> > also when replying please send me a copy...
> >
> > in function js_correct(value,corr) I've found the instructions:
> >
> > if (value < -32767) return -32767;
> > if (value > 32767) return 32767;
> >
> > what's the use of these? I'm asking because my new usb-joystick
> > is returning those values somewhere in the middle of it's threshold
> > and I was wondering if disabling the above would do any good?
> 
> The data coming from the joystick is defined to be bound by this range.
> It's signed 16 bit anyway.

I see, I was just wondering why only 16 and not 32 bit or something.
also after noticing that the little throttle-thing at the top was
not reporting any difference between the most left value and some
1/5 to the right of it, I turned off these lines (in joydev.c),
and now on every axis jstest reports (after an overflow) that the
lowest value is 27700 and the highest value is -27363 (except of
course for the non-analogue axes). could it be possible to fix the
driver in a way to make this throttle-thing work correctly in those
extreme postitions? on the other axes it is indeed a physical limitation
which lets them get their extreme values somewhere in the middle
between center and bumping into the edge, but considering the
thin and fragile construction I would hesitate to let it bump into
the threshold anyway...
> 
> > however, the actual reason why I've looked into that file was
> > because wine reported strange joystick-events 6,7,8,9 and I
> > just can't figure out what those are supposed to do. I've found
> > JS_EVENT 1 and 2 in the linux/joystick.h include, but no mention
> > of anything related to the number '6'. does anyone know anything
> > about those joystick events?
> 
> What joystick is it? This looks like a problem with the HID driver.

It's a [Logitech Inc. WingMan RumblePad]. it has 5 "analogue"
axes (0,1 and 3,4 and 2 being the throttle) and 2 typical for a
gamepad (5,6 -- unless button 12 is switched on, in which case
the axes 5,6 are switched with the axes 0,1 and both become
non-analogue axes with my modified joydev reporting 28038 as the
minimum and -27701 as the maximum-value for the 2 gamepad-axes).
However, jstest reports 10 axes (7,8,9 always at the lowest value),
and also the buttons 9,10 and 13-19 are unused (vibration-feedback?),
it would be nice if those "unused" stuff could stop being displayed...

unfortunately I only have win95, so I can't check how it is handled
there (since even with usb-supplement there is no full hid-support).
I just would *guess* that the above-mentioned throttle-problem isn't
meant to be handled this way...

Oh, and I probably should also mention that I'm using an old usb-chip
and the usb-uhci driver from my 2.2.21 kernel...

for the mailing-list: when replying please send me a copy.

P

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-07-12 16:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-09 10:21 joystick.c Piotr Sawuk
2002-07-09 16:17 ` joystick.c Thunder from the hill
2002-07-09 16:38 ` joystick.c Vojtech Pavlik
2002-07-12  5:00   ` joystick.c Piotr Sawuk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®