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

On Thu, 28 Nov 2002 10:13, [EMAIL PROTECTED] wrote:
> When you say it'll need to be added to the driver source code - in what
> sense do you mean this? Why does hacking the modules table make you
> pessimistic? I know nothing about USB and I can't seem to find the answers
> to the questions I need from the FAQs... I assume it is very difficult to
> modify the driver source?
Firstly, my apologies for taking so long to respond. It was a v. busy week.

It isn't difficult to modify the code. However it may not be neccessary - I'd 
prefer to use the HID driver as much as possible.
> T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  3 Spd=12  MxCh= 0
> D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
> P:  Vendor=5543 ProdID=0004 Rev= 0.00
> C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=100mA
> I:  If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=hid
> E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=9ms
Tablet: OK, the device claims to be HID compliant, and the HID driver is 
picking it up.

> T:  Bus=01 Lev=01 Prnt=01 Port=01 Cnt=02 Dev#=  2 Spd=1.5 MxCh= 0
> D:  Ver= 1.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
> P:  Vendor=04b3 ProdID=3100 Rev= 4.41
> C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=100mA
> I:  If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=02 Driver=hid
> E:  Ad=81(I) Atr=03(Int.) MxPS=   5 Ivl=10ms
Mouse: And again here, were are seeing the device claiming to be HID compliant 
(and will also work eith the mouse boot protocol - that is what the Sub=01 
and Prot=02 means).

> > Also, can you get
> > http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/linuxconsole/ru
> >by/utils/evtest.c?rev=1.19> and test each device? For the mouse, it would
> > help if you could> annotate the> output with what actions corresponded to
> > which outputs (eg "these three lines  occurred when I pressed and
> > released the middle button")>
>
> Wow! That's exactly the sort of thing I was looking for. Unfortunately
> when trying to compile (just using gcc evtest.c) I get :
> evtest.c: In function `main':
> evtest.c:168: `EV_SYN' undeclared (first use in this function)
> evtest.c:168: (Each undeclared identifier is reported only once
> evtest.c:168: for each function it appears in.)
EV_SYN was introduced for 2.5. You could get an earlier version of evtest, or 
remove the test that looks for EV_SYN, since current 2.4 doesn't send it.

> Input driver version is 1.0.0
> Input device ID: bus 0x3 vendor 0x4b3 product 0x3100 version 0x441
> Input device name: "04b3:3100"
> Supported events:
>   Event type 1 (Key)
>     Event code 272 (LeftBtn)
>     Event code 273 (RightBtn)
>     Event code 274 (MiddleBtn)
>   Event type 2 (Relative)
>     Event code 0 (X)
>     Event code 1 (Y)
>     Event code 2 (Z)
>     Event code 8 (Wheel)
> Testing ... (interrupt to exit)
So your device says it has four relative axes - the normal X/Y for a mouse, a 
vertical wheel, and something else that says it is the Z axis. I've attached 
some additional code that will print out events. Its crude and inefficient, 
but it might show you some results. Could you give it a try?
The next thing to think about is what action you want the Z axis to perform.

I'm still not sure about the superpen tablet. We need to figure out if it can 
meet the HID requirements, or we need to try one of the other drivers. Give 
the trivial read-event a try, and I'll think about the problem a bit more.

Brad
- -- 
http://linux.conf.au. 22-25Jan2003. Perth, Aust. I'm registered. Are you?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE96AX1W6pHgIdAuOMRAiC6AJ9NAcE+cRIYb5JrYMMX9fRP1fURWwCdEllA
JbWKEaWlJnt05jP/i25i6OA=
=QJkx
-----END PGP SIGNATURE-----
/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or 
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 */


#include <stdlib.h>
#include <stdio.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <asm/types.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdint.h>

#include <linux/input.h>


int main (int argc, char **argv) {

    int fd = -1;        /* the file descriptor for the device */
    int yalv;           /* loop counter */
    size_t read_bytes;  /* how many bytes were read */
    struct input_event ev[64]; /* the events (up to 64 at once) */

    /* read() requires a file descriptor, so we check for one, and then open it */
    if (argc != 2) {
	fprintf(stderr, "usage: %s event-device - probably /dev/input/event0\n", argv[0]);
	exit(1);
    }
    if ((fd = open(argv[1], O_RDONLY)) < 0) {
	perror("evdev open");
	exit(1);
    }

    while (1)
	{
	read_bytes = read(fd, ev, sizeof(struct input_event) * 64);

	if (read_bytes < (int) sizeof(struct input_event)) {
	    perror("evtest: short read");
	    exit (1);
	}

	for (yalv = 0; yalv < (int) (read_bytes / sizeof(struct input_event)); yalv++)
	    {
		if (EV_KEY == ev[yalv].type) 
		    printf("Event: time %ld.%06ld, type %d, code %d, value %d\n",
			   ev[yalv].time.tv_sec, ev[yalv].time.tv_usec, ev[yalv].type,
			   ev[yalv].code, ev[yalv].value);
	    }
	}

    close(fd);

    exit(0);
}

Reply via email to