printf("ph: %u\n", EVIOCGRAB());
open my $dev, "<", "/dev/input/event7" or die $!;
grab($dev->fileno, 1);
__END__
__C__
#include <linux/input.h>
void grab(int fd, int act) {
printf("c: %u\n", EVIOCGRAB);
int r = ioctl(fd, EVIOCGRAB, act);
printf("grab: %d\n", r);
}
And sure enough it prints:
ph: 1073759632
c: 1074021776
So for whatever reason there is a mismatch.
If I don't use the .ph-files but simply do ioctl $dev, 1074021776, 1;it works.
So it seems the problem lies with h2ph....
The way I generated the phs was I went to /usr/include and from there I issued "h2ph -a -d <some output-dir> linux/input.h"
Was that the wrong way to do it? And is it normal that I have to do that on my own (as I said I installed via perlbrew and there were no .phs generated then?
But at least I know how to do it now...
|