Re: Using keyboard's _multimedia_ keys ?

Guest section DW (dwguest@win.tue.nl)
Tue, 20 Jul 1999 01:59:03 +0200 (MET DST)


From: Arjan Filius <arjan@nospam.xs4all.nl>

> Arjan Filius <iafilius@xs4all.nl> writes:
>
> |> I would like to bind such key to a program executed, but running with user
> |> ID which typed that key.
>
> How are you going to find out who typed that key?

That's part of the problem.
I'm able to bind scancodes to keycodes (setkeykodes), and use loadkeys
with using KeyboardSignal to send a signal to init, which spawns an
executable. But then (when multiple keys defined to be on that
KeyboardSignal, it's not possible to find out which key was pressed and
not which user.

If you want to go via KeyboardSignal then the work has been done
already - see the dynamic_vc package. The idea would be that you
use one key (the one that produces the signal) to wake up this process
that you started after logging in. It reads the following key(s) as
commands, and when done switches back to your previous session.

But if you dislike typing two keys where one would suffice,
then it seems to me that the right approach would be to forget
about KeyboardSignal, and use something with pseudottys, like script,
that examines what you type and either executes the corresponding
command, or transmits it to your foreground program.
Then you have to pick codes that these new keys produce.
You can bind them to strings that are unlikely to occur in your
typed text. But you could also put the keyboard in keycode mode.

Several possibilities. Maybe all exist already - they are easy to program -
but I am unaware of things other than dynamic_vc.

Andries

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/