multi-touch-dev team mailing list archive
-
multi-touch-dev team
-
Mailing list archive
-
Message #00107
Re: n-trig updates
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 04/08/10 20:24, Bryce Harrington wrote:
> On Thu, Apr 08, 2010 at 05:46:20PM -0400, Rafi Rubin wrote:
>>> Bus 002 Device 010: ID 1926:0064
>>> Bus 002 Device 009: ID 0424:2514 Standard Microsystems Corp.
>>> Bus 002 Device 008: ID 05a9:2656 OmniVision Technologies, Inc.
>>> Bus 002 Device 007: ID 0424:2512 Standard Microsystems Corp.
>>
>> ps. that looks like a cool screen.
>
> Yeah it's slick looking but the screen is very glossy and a bit too
> reflective. It runs a lot cooler than my BENQ's.
>
>> quick google search suggests omnivision is a camera and smsc makes "capacitive
>> touch sensors" among other things.
>
> Device 10 seems to be the touchscreen device. Not sure why it didn't
> show a name in the lsusb output.
>
> Bryce
Since you have an event device, you shouldn't need to mod the kernel for the
first round of testing. IS_INPUT_APPLICATION probably is not a problem.
The names aren't set entirely automatically. I only added the "N-Trig *"
strings pretty recently (feb I think). I'm not sure why its not doing a better
job of naming generic devices. Perhaps that's something I should explore when I
have time.
Would you grab me a binary capture of the event device, and which ever of the
hiddev nodes is active.
If you want a quick test, run finger_pos on the event device. I'm raising the
finger limit to 20, just for you. The smsc site lists sensors from 3 to 14
"channels", and I'd like to see how many fingers yours handles, well you might
need to use some toes if you do have the 14 channel controller.
Rafi
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAku+dmoACgkQwuRiAT9o608IcgCcCgnFi8auC+lWTJkaPACWFOS7
bEoAnjOft638xqLMTviXBF0TelshkK8r
=Zo1e
-----END PGP SIGNATURE-----
/*
Desktop switch sample, needs KWin to run
*/
#include <linux/input.h>
#include <stdint.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
//#include "stan.h"
typedef struct point { int x; int y; int id; } point;
point points[20]= { [0 ... 19] = {.x=0, .y=0, .id=-1 } };
int st_x;
int st_y;
int gesture[20][2] = {[0 ... 19][0 ... 1] = 0} ;
int totalC=0;
int sensitivity=8000; // define the sensitivity of the gesture recognition
void print_points(int n)
{
int i=0;
/*
printf(" st ",i);
for(i=0;i<n;i++)
{
printf(" %d ",i);
}*/
//printf("\n");
// printf(" %4d,%4d ",st_x,st_y);
for(i=0;i<n;i++)
{
if(points[i].id>=0)
printf(" %4d,%4d ",points[i].x,points[i].y);
else
printf("%11s","");
}
printf("\n");
}
/////////////////////////////////////////////////////////////////////
int main (int argc, char **argv)
{
int fd, rd, i, j, k;
struct input_event ev[64];
int version;
unsigned short id[4];
char name[256] = "Unknown";
struct point tmpP;
int contactsNum=0, actual=0, change=0;
if (argc < 2) {
printf("Usage: evtest /dev/input/eventX\n");
return 1;
}
if ((fd = open(argv[argc - 1], O_RDONLY)) < 0) {
perror("evtest");
return 1;
}
ioctl(fd, EVIOCGNAME(sizeof(name)), name);
printf("Input device name: \"%s\"\n", name);
printf("Reading input from device ... (interrupt to exit)\n");
tmpP.id=0;
while (1) { // Main loop
rd = read(fd, ev, sizeof(struct input_event) * 64);
if (rd < (int) sizeof(struct input_event)) {
perror("\nevtest: error reading");
return 1;
}
for (i = 0; i < rd / sizeof(struct input_event); i++)
if (ev[i].type == EV_SYN) {
if (2==ev[i].code) { // MT_Sync : Multitouch event end
if(tmpP.id++>=0)
{
points[tmpP.id].id=tmpP.id;
points[tmpP.id].x=tmpP.x;
points[tmpP.id].y=tmpP.y;
}
} else if (0==ev[i].code) { // Ev_Sync event end
if(tmpP.id>=0)
{
totalC=tmpP.id+1;
contactsNum=0;
print_points(tmpP.id+1);
tmpP.id=-1;
tmpP.x=0;
tmpP.y=0;
for(j=0;j<10;j++)
{
points[j].id=-1;
}
}
tmpP.id=0;
}
} else if (ev[i].type == EV_MSC && (ev[i].code == MSC_RAW || ev[i].code == MSC_SCAN)) {
} else {
//printf("code %d\n",ev[i].code);
// if (ev[i].code==57) { tmpP.id = ev[i].value; contactsNum++; }
if (ev[i].code==0) st_x = ev[i].value;
if (ev[i].code==1) st_y = ev[i].value;
if (ev[i].code==53) tmpP.x = ev[i].value;
if (ev[i].code==54) tmpP.y = ev[i].value;
} /* Every multitouch single point is saved in order to be handled */
}
}
References
-
Re: n-trig updates
From: Stéphane Chatty, 2010-04-07
-
Re: n-trig updates
From: Bryce Harrington, 2010-04-07
-
Re: n-trig updates
From: Stéphane Chatty, 2010-04-07
-
Re: n-trig updates
From: Bryce Harrington, 2010-04-07
-
Re: n-trig updates
From: Stéphane Chatty, 2010-04-08
-
Re: n-trig updates
From: Rafi Rubin, 2010-04-08
-
Re: n-trig updates
From: Bryce Harrington, 2010-04-08
-
Re: n-trig updates
From: Rafi Rubin, 2010-04-08
-
Re: n-trig updates
From: Bryce Harrington, 2010-04-08
-
Re: n-trig updates
From: Rafi Rubin, 2010-04-08
-
Re: n-trig updates
From: Bryce Harrington, 2010-04-09