On Wed, Jun 24, 1998 at 10:13:53 PM +0200, Vojtech Pavlik wrote:> On Wed, Jun 24, 1998 at 02:23:35AM -0400, Allanah Myles wrote:> > If we're safe to assume that 8 (2^3) devices of any one type is> > sufficient, and that there will never be more than 32 (2^5) different> > types of devices, then we can represent this information in 1 byte. We're> > basically saying that each device/ID# is unique, allowing for a *total*> > of 255 (2^8) possible devices (although no more than 8 in any category).> > I think this is sufficient.> > Yes. Myself I think we could leave out the devicetype field at all.I don't think so... that way you couldn't search for a certian device, orfind out what the type of a device is given an arbitrary node. However, Idon't think we need to stamp every delta with it. Keep it out of band, inan IOCTL where we don't have to worry about space. (Along with other infoabout the device -- semi-standard keys on a keyboard, odd buttons on amouse (rollers, rocker-switches, etc)...)

> > > 8 bytes: a base64 (32 through 95) timestamp containing a 32-bit value> > > (unix time) and a 16-bit value (number of 65536ths of seconds)> > Timestamping isn't silly, as I explain in another reply to you.> It's actually very much needed.Indeed. However, I think a simple jiffy-count will do nicely.

> > > 3 bytes: the argument to the event:> > > > Since even the standard PC keyboard has 102 keys (and some have a few> > more), I'd venture to say that no one device will have more than> > 255 (2^8) "keys" or identifiable inputs. For items with absolute> > positionings, I think -127..128 is a bit small of a range. Since the> > we only used 4 bits for the event-type, lets make this 12 bits large,> > which will give us a range of -4095..4096, which should be plenty.> > 12 bits is too small as well, imagine a high resolution tablet. It won't> do. 16 bits is much better, maybe 32 would be best.I think your both forgetting that we need to give the axis number and theposition.

Make it a varable number of even bytes. I'm thinking that each read wouldreturn one event, so the end of the read can signify the end of the event.Otherwise, give a count of bytes then the data.