[lkml]   [2004]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: Do not use synaptics extensions by default
    Sean Neakums <> writes:

    > Vojtech Pavlik <> writes:
    > > On Sat, Jan 10, 2004 at 08:18:22PM +0000, Sean Neakums wrote:
    > >
    > >> Will this also result in the passthough port not being enabled?
    > >> (I'd like to disable it.)
    > >
    > > It depends on the touchpad firmware. Most leave it enabled.
    > > In this mode we don't have any control over the passthrough port.
    > I notice that the passthrough appears as an extra device (mouse1 on my
    > system). Is there a way to disable devices from userspace?

    You can write a program that grabs the event device for exclusive
    access and then just ignores all events, like this:

    #include <sys/types.h>
    #include <sys/stat.h>
    #include <fcntl.h>
    #include <stdio.h>
    #include <errno.h>
    #include <sys/ioctl.h>
    #include <unistd.h>
    #include <string.h>
    #include <stdlib.h>

    /* From linux/include/linux/input.h */
    struct input_event {
    struct timeval time;
    unsigned short type;
    unsigned short code;
    unsigned int value;

    #define EVDEV "/dev/input/event0"

    #define EVIOCGRAB _IOW('E', 0x90, int) /* Grab/Release device */

    int main(int argc, char* argv[])
    const char* devName = EVDEV;
    int fd;
    int ret;

    if (argc > 1)
    devName = argv[1];

    fd = open(devName, O_RDONLY);
    if (fd < 0) {
    fprintf(stderr, "Can't open file %s, errno:%d (%s)\n",
    devName, errno, strerror(errno));

    ret = ioctl(fd, EVIOCGRAB, 1);
    if (ret < 0) {
    printf("Can't grab event device, errno:%d (%s)\n",
    errno, strerror(errno));

    for (;;) {
    struct input_event ev;
    read(fd, &ev, sizeof(ev));

    return 0;

    Peter Osterlund -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 13:59    [W:0.022 / U:41.652 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site