Re: uniform input device packets?

Pavel Machek (pavel@atrey.karlin.mff.cuni.cz)
Thu, 25 Jun 1998 12:46:55 +0200


Hi!

> > Right. That's why I said that we'd be better off with bools and ints and
> > rel. ints, rather then keys/buttons and axes. (I hadn't even thought of
> > force-feedback. Not a gamer -- last joystick I held was on an Atari 2600.)
>
> Not a gamer here, too. However a joystick driver author. :)
>
> > > > I'd go for 4. We want to provide _lots_ of room to grow. Remember when
> > > > 640k was enough for anybody? I think here 64k will do, but 256 is a bit
> > > > short. (Yes, the current keyboard driver gets away with 128.)
> > Whops. Memory-numbers-bad. I meant 3*.
>
> Good, I'm glad we agree here. So it's now:
>
> struct input_event {
> __u32 timestamp;

What does timestamp==1 mean? 1sec? 1msec? 1usec?

> __u16 value;
> __u16 number;
> __u8 type;
> __u8 device number; (Do we need this?)
> };

I would like structure to be 8bytes. (So 64bit machines could put it
into register at once). 10bytes seems little weird size, to me.

What about

__u32 timestamp;
__u16 value;
__u8 type;
__u8 spare;

This is 8 bytes total.

Where type==0: button press, type==1: button release (value is which
button). Type >128 means (axis-128) moved.

Pavel

-- 
The best software in life is free (not shareware)!		Pavel
GCM d? s-: !g p?:+ au- a--@ w+ v- C++@ UL+++ L++ N++ E++ W--- M- Y- R+

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu