Subject: Re: wsmux inject
To: None <tech-kern@netbsd.org>
From: Iain Hibbert <plunky@rya-online.net>
List: tech-kern
Date: 03/14/2006 18:04:57
On Tue, 14 Mar 2006, Martin Husemann wrote:

> On Mon, Mar 13, 2006 at 10:07:35PM +0000, Iain Hibbert wrote:
> > Hi,
> >   looking to inject events into wsmux from userland - have opened
> > "/dev/wsconsctl0" (wsmouse) and "/dev/wsconsctl1" (wskbd) for writing, and
> > injecting mouse events works fine, but keyboard events are vanishing in
> > the kernel. After enabling wsmux_debug, I get this:
>
> Looking at wsmux_open it sounds like you need to open /dev/wskbd for writing,
> that should be all that is needed.

Hm, sort of - If I open that for reading with "hexdump /dev/wsmux1", then
I can see the injected events showing on that input stream.

But what I want is for wsdisplay0 to be reading from wsmux1 so that I can
inject events and have them appear as normal keyboard events by wsdisplay0.

I see the following in wskbd_attach()

	mux = sc->sc_base.me_dv.dv_cfdata->wskbddevcf_mux;
	if (ap->console) {
		/* Ignore mux for console; it always goes to the console mux. */
		/* printf(" (mux %d ignored for console)", mux); */
		mux = -1;
	}

which could be causing this behaviour?

Is this 'console mux' available to inject events into, or am I doomed?

iain