Has anyone had any luck using _POINTERGETINFO to dynamically determine the
type (mouse or touch) of an input device? I posted about this awhile back,
but I think the server ate my post (or maybe my newsreader did it). Note
that I’m interested in using a pointer device via the resource manager
interface. Basically my problem is that I tried using this macro, and it
didn’t really work. The snippet below is what I tried, using an opened
device. I usually get an “Inappropriate I/O control operation” error.
static int getInfo(int fd) {
struct _pointer_info info;
int buf[100];
int rc;
memset(&info,0,sizeof(info));
rc = devctl(fd,_POINTERGETINFO,&info,sizeof(info),buf);
if (rc != EOK) {
printf(“Could not get device info: %s\n”,strerror(rc));
return 1;
}
printf(“info.type.type 0x%08X\n”,info.type.type);
return EOK;
}
Anyone have any clues? Alex, are you still around?
You should analize flag field (two possible values are _POINTER_FLAG_TOUCH
and _POINTER_FLAG_MOUSE. (see sys/dcmd_input.h). Field type is always
_INTERACT_TYPE_POINTER whether you use mouse or touchscreen as a pointer
device.
Has anyone had any luck using _POINTERGETINFO to dynamically determine the
type (mouse or touch) of an input device? I posted about this awhile
back,
but I think the server ate my post (or maybe my newsreader did it). Note
that I’m interested in using a pointer device via the resource manager
interface. Basically my problem is that I tried using this macro, and it
didn’t really work. The snippet below is what I tried, using an opened
device. I usually get an “Inappropriate I/O control operation” error.
static int getInfo(int fd) {
struct _pointer_info info;
int buf[100];
int rc;
memset(&info,0,sizeof(info));
rc = devctl(fd,_POINTERGETINFO,&info,sizeof(info),buf);
if (rc != EOK) {
printf(“Could not get device info: %s\n”,strerror(rc));
return 1;
}
printf(“info.type.type 0x%08X\n”,info.type.type);
return EOK;
}
Anyone have any clues? Alex, are you still around?
Thanks, but I guess I wasn’t clear enough in my original post. I am
unable to get anything back from the device I am working with. I am using
/dev/devi/mouse0 on an x86 box running version 6.1. I use the following
command to start the input drivers when I am not in Photon mode:
“/usr/photon/bin/devi-hirun -Pr kbd fd -d /dev/kbd ps2 mousedev rel -y” I
am able to read _mouse_packet structs correctly, but apparently the devctl
interface is broken. Is this a standard interface, or is it device
specific? Since the API for this interaction is available, I don’t
understand why it won’t work.
Unfortunatelly, _POINTERGETINFO in current version is supported only in
Photon mode (_Ph_SERV_POINTER request - see include/photon/PhMsg.h). That is
why you cannot get any replay from devctl function. The request from the
Photon application should look (this is just a rough sample) like the
following snippet:
Thanks, but I guess I wasn’t clear enough in my original post. I am
unable to get anything back from the device I am working with. I am using
/dev/devi/mouse0 on an x86 box running version 6.1. I use the following
command to start the input drivers when I am not in Photon mode:
“/usr/photon/bin/devi-hirun -Pr kbd fd -d /dev/kbd ps2 mousedev rel -y” I
am able to read _mouse_packet structs correctly, but apparently the devctl
interface is broken. Is this a standard interface, or is it device
specific? Since the API for this interaction is available, I don’t
understand why it won’t work.
Unfortunatelly, _POINTERGETINFO in current version is supported only in
Photon mode (_Ph_SERV_POINTER request - see include/photon/PhMsg.h). That
is
why you cannot get any replay from devctl function. The request from the
Photon application should look (this is just a rough sample) like the
following snippet:
Charlie_Surface@oti.com> > wrote in message
news:a609h4$km3$> 1@inn.qnx.com> …
Thanks, but I guess I wasn’t clear enough in my original post. I am
unable to get anything back from the device I am working with. I am
using
/dev/devi/mouse0 on an x86 box running version 6.1. I use the following
command to start the input drivers when I am not in Photon mode:
“/usr/photon/bin/devi-hirun -Pr kbd fd -d /dev/kbd ps2 mousedev rel -y”
I
am able to read _mouse_packet structs correctly, but apparently the
devctl
interface is broken. Is this a standard interface, or is it device
specific? Since the API for this interaction is available, I don’t
understand why it won’t work.