Re: Detecting keypress on console

2019-03-29 Thread Paul Goyette
On Fri, 29 Mar 2019, Paul Goyette wrote: On Fri, 29 Mar 2019, Michael van Elst wrote: On Fri, Mar 29, 2019 at 08:39:24AM +0800, Paul Goyette wrote: Hmmm. On my amd64 8.99.35 system, I get # wsmuxctl -f /dev/wsmux1 -l wskbd0 Segmentation fault (core dumped) Someone added a WSMUX_BELL devic

Re: Detecting keypress on console

2019-03-28 Thread Paul Goyette
On Fri, 29 Mar 2019, Michael van Elst wrote: On Fri, Mar 29, 2019 at 08:39:24AM +0800, Paul Goyette wrote: Hmmm. On my amd64 8.99.35 system, I get # wsmuxctl -f /dev/wsmux1 -l wskbd0 Segmentation fault (core dumped) Someone added a WSMUX_BELL device but forgot to support it in wsmuxctl. Th

Re: Detecting keypress on console

2019-03-28 Thread Michael van Elst
On Fri, Mar 29, 2019 at 08:39:24AM +0800, Paul Goyette wrote: > Hmmm. On my amd64 8.99.35 system, I get > > # wsmuxctl -f /dev/wsmux1 -l > wskbd0 > Segmentation fault (core dumped) Someone added a WSMUX_BELL device but forgot to support it in wsmuxctl. The devnames array in wsmuxctl needs to be

Re: Detecting keypress on console

2019-03-28 Thread Paul Goyette
On Fri, 29 Mar 2019, Paul Goyette wrote: Hmmm. On my amd64 8.99.35 system, I get # wsmuxctl -f /dev/wsmux1 -l wskbd0 Segmentation fault (core dumped) According to my dmesg, I should also have wsbell0 at spkr0 mux 1 listed for mux1... # gdb /usr/sbin/wsmuxctl ... Reading symbols from /

Re: Detecting keypress on console

2019-03-28 Thread Paul Goyette
Hmmm. On my amd64 8.99.35 system, I get # wsmuxctl -f /dev/wsmux1 -l wskbd0 Segmentation fault (core dumped) # gdb /usr/sbin/wsmuxctl ... Reading symbols from /usr/sbin/wsmuxctl...Reading symbols from /usr/libdata/debug//usr/sbin/wsmuxctl.debug...done. done. (gdb) target core wsmuxctl.core [Ne

Re: Detecting keypress on console

2019-03-28 Thread Michael van Elst
On Thu, Mar 28, 2019 at 04:33:00PM +, Emmanuel Dreyfus wrote: > On Thu, Mar 28, 2019 at 02:41:08PM -, Michael van Elst wrote: > > Maybe /dev/wsmux1 ? wsmux0 is mouse input. > > Same fate. Is it expect behavior that muxctl -f $i -l lists nothing > for any $i ? % sudo wsmuxctl -f /dev/wsmux

Re: Detecting keypress on console

2019-03-28 Thread Valery Ushakov
On Thu, Mar 28, 2019 at 13:54:21 +, Emmanuel Dreyfus wrote: > On Sat, Mar 23, 2019 at 02:23:19PM -, Valery Ushakov wrote: > > Alternatively you should also be able re-inject wsevents you are not > > interested in back into the wsmux (instead of doing that at tty(4) > > level as tls@ sugges

Re: Detecting keypress on console

2019-03-28 Thread Emmanuel Dreyfus
On Thu, Mar 28, 2019 at 02:41:08PM -, Michael van Elst wrote: > Maybe /dev/wsmux1 ? wsmux0 is mouse input. Same fate. Is it expect behavior that muxctl -f $i -l lists nothing for any $i ? -- Emmanuel Dreyfus m...@netbsd.org

Re: Detecting keypress on console

2019-03-28 Thread Michael van Elst
m...@netbsd.org (Emmanuel Dreyfus) writes: >I tried reading wscons_event from /dev/wskbd0 and it works like >a charm, but reinjecting the event with WSMUXIO_INJECTEVENT in >/dev/wsmux0 while /dev/wskbd is still open will not do the job: >the process running on the console does not see the input.

Re: Detecting keypress on console

2019-03-28 Thread Emmanuel Dreyfus
On Sat, Mar 23, 2019 at 02:23:19PM -, Valery Ushakov wrote: > Alternatively you should also be able re-inject wsevents you are not > interested in back into the wsmux (instead of doing that at tty(4) > level as tls@ suggested). I tried reading wscons_event from /dev/wskbd0 and it works like a

Re: Detecting keypress on console

2019-03-28 Thread Robert Elz
Date:Thu, 28 Mar 2019 03:44:32 +0100 From:m...@netbsd.org (Emmanuel Dreyfus) Message-ID: <1o54q7j.12nkmgacatowxm%m...@netbsd.org> | Would it make sense to add a knote in wscons for keypresses, so that | they can be readen using kevent? If modifying wscons is an ac

Re: Detecting keypress on console

2019-03-27 Thread Emmanuel Dreyfus
Thor Lancelot Simon wrote: > > I would like to execute a scipt when a function key is pressed on the > > console. Is there a mechanism to detect keypresses on wscons? If I > > make a daemon that opens /dev/console it will steal the input from > > getty/login/sh, which is not what I intend. > >

Re: Detecting keypress on console

2019-03-26 Thread Emmanuel Dreyfus
Emmanuel Dreyfus wrote: > If I understand correctly, I read the character I reinjected: when > I press a key, I get tons of repetitions. How can I work that around? It seems I was wrong here, it looks like a VMIN/VTIME problem. -- Emmanuel Dreyfus http://hcpnet.free.fr/pubz m...@netbsd.org

Re: Detecting keypress on console

2019-03-26 Thread Emmanuel Dreyfus
On Sun, Mar 24, 2019 at 12:41:34AM -0400, Thor Lancelot Simon wrote: > > That let's me inject data as if it was typed on the terminal right? You > > suggest I steal input from console and reinject it using TIOCSTI > > afterwards? > > It's horrible, but, it should work. If I understand correctly,

Re: Detecting keypress on console

2019-03-23 Thread Thor Lancelot Simon
On Sat, Mar 23, 2019 at 08:28:38AM +0100, Emmanuel Dreyfus wrote: > Thor Lancelot Simon wrote: > > > Hold your nose and TIOCSTI. > > That let's me inject data as if it was typed on the terminal right? You > suggest I steal input from console and reinject it using TIOCSTI > afterwards? It's horr

Re: Detecting keypress on console

2019-03-23 Thread Valery Ushakov
Emmanuel Dreyfus wrote: > I would like to execute a scipt when a function key is pressed on the > console. Is there a mechanism to detect keypresses on wscons? If I > make a daemon that opens /dev/console it will steal the input from > getty/login/sh, which is not what I intend. May be abuse p

Re: Detecting keypress on console

2019-03-23 Thread Emmanuel Dreyfus
Thor Lancelot Simon wrote: > Hold your nose and TIOCSTI. That let's me inject data as if it was typed on the terminal right? You suggest I steal input from console and reinject it using TIOCSTI afterwards? -- Emmanuel Dreyfus http://hcpnet.free.fr/pubz m...@netbsd.org

Re: Detecting keypress on console

2019-03-22 Thread Thor Lancelot Simon
On Fri, Mar 22, 2019 at 04:11:31PM +, Emmanuel Dreyfus wrote: > Hello > > I would like to execute a scipt when a function key is pressed on the > console. Is there a mechanism to detect keypresses on wscons? If I > make a daemon that opens /dev/console it will steal the input from > getty/lo

Detecting keypress on console

2019-03-22 Thread Emmanuel Dreyfus
Hello I would like to execute a scipt when a function key is pressed on the console. Is there a mechanism to detect keypresses on wscons? If I make a daemon that opens /dev/console it will steal the input from getty/login/sh, which is not what I intend. Any idea? -- Emmanuel Dreyfus m...@netb