mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Osterlund <petero2@telia.com>
To: Sean Neakums <sneakums@zork.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Do not use synaptics extensions by default
Date: 10 Jan 2004 22:33:32 +0100	[thread overview]
Message-ID: <m2u133qyj7.fsf@p4.localdomain> (raw)
In-Reply-To: <6uwu7z5y1y.fsf@zork.zork.net>

Sean Neakums <sneakums@zork.net> writes:

> Vojtech Pavlik <vojtech@suse.cz> 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));
	exit(1);
    }

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

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

    close(fd);
    return 0;
}

-- 
Peter Osterlund - petero2@telia.com
http://w1.894.telia.com/~u89404340

  reply	other threads:[~2004-01-10 21:33 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-10 17:59 Pavel Machek
2004-01-10 18:52 ` Sean Neakums
2004-01-10 19:28 ` Dmitry Torokhov
2004-01-10 19:40   ` Marcel J.E. Mol
2004-01-10 19:46     ` Pavel Machek
2004-01-10 20:29     ` Peter Osterlund
2004-01-10 19:51   ` Pavel Machek
2004-01-10 19:56     ` Vojtech Pavlik
2004-01-10 20:10       ` Pavel Machek
2004-01-10 20:15         ` Vojtech Pavlik
2004-01-10 23:52           ` Dmitry Torokhov
2004-01-11  8:13             ` Vojtech Pavlik
2004-01-10 19:30 ` Vojtech Pavlik
2004-01-10 19:44   ` Pavel Machek
2004-01-10 19:55     ` Vojtech Pavlik
2004-01-10 20:18       ` Sean Neakums
2004-01-10 20:23         ` Vojtech Pavlik
2004-01-10 20:49           ` Sean Neakums
2004-01-10 21:33             ` Peter Osterlund [this message]
2004-01-10 21:47               ` Sean Neakums
2004-01-10 23:42       ` Dax Kelson
2004-01-11  8:12         ` Vojtech Pavlik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2u133qyj7.fsf@p4.localdomain \
    --to=petero2@telia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sneakums@zork.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®