From: Vojtech P. <vo...@su...> - 2002-04-17 13:18:22
|
On Wed, Apr 17, 2002 at 09:56:05PM +1000, Brad Hards wrote: > On Wed, 17 Apr 2002 18:21, Vojtech Pavlik wrote: > <snip> > > Not really a 2d bitfield, more like a bunch of 1d bitfields with uneven > > lengths. You pass an argument selecting which one you want and you get > > it. I think EVIOCGBIT is quite OK, because it doesn't really depend on > > the data type ... it just copies a chunk of memory. > > > > What is probably the only wrong w/ the bit arrays is the way they're > > passed through by /proc and hotplug support. And that can be fixed > > without any major pain, because noone is using that on 64-bit systems > > yet. > OK, no issue on 2.4, correct? > This was stuff you added in 2.5? > > ><snip> > > ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(my_buffer)), buffer); > Ah, I think I have it now. For > > ioctl(a, EVIOCGBIT(b, c), d) > > a is the file descriptor for the event device you want > > b is the type of descriptor bitfield to return > 0 for the type of descriptors that are used > EV_KEY for the key bitfield > EV_REL for the relative axes bitfield > EV_ABS for the absolute axes bitfield > EV_MSC for the miscellaneous bitfield (not used yet?) > EV_LED for the bright lights bitfield > EV_SND for the loud noises bitfield > EV_REP for the repeat function bitfield (not used yet?) > EV_FF for the force feedback bitfield > > c is the maximum number of bits to return > If the number of bits available is greater, then you get a warning message Bytes. > d is a pointer to the memory to put the bitfield Yes. > and the return value is the number of bits transfered (if it succeeds) or > -EFAULT if it fails. Bytes, again. > The number of bits transferred is the lesser of c, and > the number of bits for that descriptor type (eg forb == 0, it is EV_MAX, b > == EV_KEY, it is KEY_MAX; for b == EV_REL it is REL_MAX, and so on). > > OK, my only question now is "how do you get the descriptor bitfield for > EV_RST?" There is none. There are no bits for EV_RST, it's only one event in its own class. -- Vojtech Pavlik SuSE Labs |