[comp.sys.next] Alternate as META key?

jgm@fed.expres.cs.cmu.edu (John G. Myers) (02/13/90)

I'm writing an application (a terminal emulator for emacs) which wants
to treat the "Alternate" key as a meta key.

If I get a keyDown event with the NX_ALTERNATEMASK, I want to find the
charCode that the event would have had if the event didn't have
NX_ALTERNATEMASK.  I can take the keyCode and do a lookup in a table
constructed from the keyboard layout given in the online manual, but
that's hardware-dependent.  Anyone have a hardware-independent
solution?

Replies to me--I'll summarize.
--
_.John G. Myers		Internet: jgm@fed.expres.cs.cmu.edu
(412) 268-2984		LoseNet:  ...!seismo!ihnp4!wiscvm.wisc.edu!give!up

jgm@fed.expres.cs.cmu.edu (John G. Myers) (02/20/90)

In article <7953@pt.cs.cmu.edu> I wrote:
>If I get a keyDown event with the NX_ALTERNATEMASK, I want to find the
>charCode that the event would have had if the event didn't have
>NX_ALTERNATEMASK.

The solution was to open /dev/evs0 and read the keyboard mapping with
the EVSIOCKM ioctl.  When I get a keyboard event with NX_ALTERNATEMASK
set, I look up the charCode for the keyCode myself.  Further details
upon request.

This won't work perfectly if the display server is running on a
different machine with a different keyboard, but it's better than
nothing.

Thanks to ramsdell@linus.mitre.org for sending me a sample program
which reads the keyboard map.




--
_.John G. Myers		Internet: jgm@fed.expres.cs.cmu.edu
(412) 268-2984		LoseNet:  ...!seismo!ihnp4!wiscvm.wisc.edu!give!up