Xref: utzoo comp.unix.xenix:5108 gnu.emacs:528 alt.sources:413 Path: utzoo!utgpu!watmath!uunet!ateng!chip From: chip@ateng.ateng.com (Chip Salzenberg) Newsgroups: comp.unix.xenix,gnu.emacs,alt.sources Subject: Meta key support for SCO Xenix 2.x Message-ID: <1989Feb24.150845.20771@ateng.ateng.com> Date: 24 Feb 89 20:08:44 GMT Followup-To: comp.unix.xenix Organization: A T Engineering, Tampa, FL Lines: 79 In lieu of a key table, here is a program that modifies any existing key layout to use Alt as a meta key. If you prefer, you can then use "mapkey -d" to generate a text version of the resulting layout. BTW, this program must be setuid root (really!) because of SCO's security restrictions on the keyboard mapping ioctl() call. #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh 'metakeys.c' <<'END_OF_FILE' X/* X * metakeys.c X * Version 1.0 X * Define Xenix keyboard so that Alt functions as an Emacs "meta" key. X * X * Written 24 Feb 1989 by Chip Salzenberg, A T Engineering. X * E-Mail complaints and kudos to or . X */ X X#include X#include X Xkeymap_t map; X Xmain() X{ X int i, j; X struct key_t *k; X X if (ioctl(0, GIO_KEYMAP, &map) == -1) X { X fprintf(stderr, "not a Xenix console\n"); X exit(1); X } X X for (i = 0; i < NUM_KEYS; ++i) X { X k = &map.key[i]; X X for (j = 0; j < ALT; ++j) X { X if (! (k->spcl & (0x80 >> j)) X && ! (k->spcl & (0x80 >> (j + ALT))) ) X k->map[j + ALT] = k->map[j] + 0x80; X } X } X X if (ioctl(0, PIO_KEYMAP, &map) == -1) X { X perror("SIO_KEYMAP"); X exit(1); X } X X exit(0); X} END_OF_FILE if test 780 -ne `wc -c <'metakeys.c'`; then echo shar: \"'metakeys.c'\" unpacked with wrong size! fi # end of 'metakeys.c' fi echo shar: End of shell archive. exit 0 -- Chip Salzenberg or A T Engineering Me? Speak for my company? Surely you jest! "It's no good. They're tapping the lines."