Avoiding keypresses during a phone call

digger vermont dv_mlist at verizon.net
Mon Nov 17 23:38:04 CET 2008


On Sun, 2008-11-16 at 19:04 +0000, Andy Green wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Somebody in the thread at some point said:
> 
> |> I have removed the mokopatch as requested the other day on
> |> stable-tracking now, it should allow an IOCTL to enable and disable
> |> touchscreen traffic as mentioned by Neil Brown:
> |>
> |> ''All we have to do is undo the kernel hack which effectively disables
> |> EVIOCGRAB and then it is trivial to turn off the touchscreen.
> |> Just open the device and issue that ioctl.''
> |
> | I have a question and comment.
> |
> | I don't yet have a grasp of IOCTL.  What would be the fcntl() or ioctl()
> | command in python to disable the touchscreeen?
> |
> | Seems like a useful method to add to frameworkd.
> 
> I found this after googling around for a bit
> 
> ~     case DEVICE_ON:
> +        if (ioctl(pInfo->fd, EVIOCGRAB, (void *)1))
> +            xf86Msg(X_WARNING, "%s: Grab failed (%s)\n", pInfo->name,
> +                    strerror(errno));
> ~         xf86AddEnabledDevice(pInfo);
> ~        device->public.on = TRUE;
> ~        break;
> 
> ~     case DEVICE_OFF:
> +        if (ioctl(pInfo->fd, EVIOCGRAB, (void *)0))
> 
> 
> ioctl() itself is easily understood, given an open file descriptor it
> gives you a side-channel into the driver that services that file
> descriptor and allows you to set and query things from the context of
> the file descriptor, without performing any actual file operations.
> 
> You can find definition of EVIOCGRAB in /usr/include/linux/input.h for
> use in usermode apps.
> 
> I don't know python but that should be enough info for a quick meddle
> around, you would first open() the file descriptor normally on
> /dev/input/event1 or whatever.

And I don't know C! But I'll see if I can digest enough of it to do
something with it. Thanks Andy.
digger
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://lists.openmoko.org/pipermail/devel/attachments/20081117/daac4c2a/attachment.pgp 


More information about the devel mailing list