Hello everyone.

I am starting to develop a system wide assistive tecnhology. To do so i 
trying to control all the input. 

So far i am able to block all the events from the touchscreen while 
monitoring them. I am also able to inject events when it is unblocked.

My goal is to is create a virtual touchscreen (using uinput) so i can 
forward the events from the blocked one while adjusting them.
 
The problem i face is that even though i am able to create the device i get 
the message 
" Touch device 'uinput-eve' did not report support for X or Y axis!Thedevice 
will be inoperable
."

This is the way i am creating the device:

struct uinput_user_dev uidev;struct input_event ev;int dx, dy;
int fd;
fd = open("/dev/uinput", O_WRONLY | O_NONBLOCK);if (fd < 0) {
    die("error: open");}

memset(&uidev, 0, sizeof(uidev));
snprintf(uidev.name, UINPUT_MAX_NAME_SIZE, "uinput-eve");
uidev.id.bustype = BUS_VIRTUAL;
uidev.id.vendor = 0x1;
uidev.id.product = 0x1;
uidev.id.version = 1;
if (write(fd, &uidev, sizeof(uidev)) < 0) {
    die("error: write");}
 /* touch screen event */
    ioctl(fd, UI_SET_EVBIT, EV_ABS);
    ioctl(fd, UI_SET_ABSBIT, ABS_X);
    ioctl(fd, UI_SET_ABSBIT, ABS_Y);
    ioctl(fd, UI_SET_EVBIT, EV_KEY);
   ioctl(fd, UI_SET_KEYBIT, BTN_TOUCH);

if (ioctl(fd, UI_DEV_CREATE,0) < 0) {
    die("error: ioctl");}

I dug a little and it seems the problem is this validation that happens in 
services/input/InputReader.cpp

// Ensure we have valid X and Y axes.if (!mRawPointerAxes.x.valid || 
!mRawPointerAxes.y.valid) {
    LOGW(INDENT "Touch device '%s' did not report support for X or Y axis!  "
            "The device will be inoperable.", getDeviceName().string());
    mDeviceMode = DEVICE_MODE_DISABLED;
    return; 

} 

The problem is that i have no idea how to solve this.  
It is my first time working with native Android and any help would be 
deeply appreciated.

Thank you for your time.

-- 
-- 
unsubscribe: android-kernel+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-kernel
--- 
You received this message because you are subscribed to the Google Groups 
"Android Linux Kernel Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-kernel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to