Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!agate!helios.ee.lbl.gov!ncis.llnl.gov!lll-lcc!ames!amdahl!uunet!allbery From: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc) Newsgroups: comp.sources.misc Subject: v06i058: Caps Lock and Num Lock for local multiscreens for SCO Xenix Keywords: caps lock num lock source Message-ID: <50625@uunet.UU.NET> Date: 8 Mar 89 01:26:35 GMT Sender: allbery@uunet.UU.NET Reply-To: jbayer@ispi.UUCP (Jonathan Bayer) Organization: Intelligent Software Products, Inc. Lines: 110 Approved: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc) Posting-number: Volume 6, Issue 58 Submitted-by: jbayer@ispi.UUCP (Jonathan Bayer) Archive-name: keylock.sco I thought that I would post this since it is so short. This program makes the keyboard caps-lock and num-lock keys local to each multiscreen or global to all the multiscreens. It is more documentation than code. It uses an undocumented ioctl() call to set the mode. Enjoy. JB --- Jonathan Bayer Beware: The light at the end of the Intelligent Software Products, Inc. tunnel may be an oncoming dragon 19 Virginia Ave. ...uunet!ispi!jbayer Rockville Centre, NY 11570 (516) 766-2867 jbayer@ispi.UUCP #! /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 'setlocklock.c' <<'END_OF_FILE' X/* ******************************************************************** * X * * X * This short program sets the behaviour of the Caps-Lock and * X * Num-Lock keys to either local or global mode. * X * * X * Calling sequence: * X * * X * setlocklock [ -l ] [ -L ] [ -g ] [ -G ] * X * * X * where: -l and -L both will set local mode * X * -g and -G both will set global mode * X * * X * Bugs: In Xenix 2.3.x, * X * The keyboard lights do not correctly show the mode * X * when in local mode. They are only updated when * X * either the Num-Lock or Caps-LOCK or Scroll-Lock * X * keys are depressed. At that time all of the lights * X * are updated correctly. This is due to the way the * X * keyboard and console drivers are now seperated. In * X * Xenix 2.2.x, the keyboard and console drivers were * X * more tightly interconnected and this problem doesn't * X * exist. * X * * X * Author: Jonathan B. Bayer * X * Intelligent Software Products, Inc. * X * 19 Virginia Ave. * X * Rockville Centre, NY 11570 * X * (516) 766-2867 * X * jbayer@ispi.UUCP or ...uunet!ispi!jbayer * X * * X * This program is hereby released to the public domain. Do * X * with it as you will. I take no resonsibility for it's actions. * X * * X * ******************************************************************** */ X X X#include X#include X#include X X X#define LOCAL 0 X#define GLOBAL 1 Xmain(argc, argv) Xchar *argv[]; Xint argc; X{ Xint mode = LOCAL, c; X X while ( (c = getopt(argc, argv,"lLgG")) != EOF) X switch (c) { X case 'l': X case 'L': X mode = LOCAL; break; X case 'g': X case 'G': X mode = GLOBAL; break; X } X X ioctl(0,SETLOCKLOCK, mode); X} END_OF_FILE if test 1811 -ne `wc -c <'setlocklock.c'`; then echo shar: \"'setlocklock.c'\" unpacked with wrong size! fi # end of 'setlocklock.c' fi echo shar: End of shell archive. exit 0 -- Jonathan Bayer Beware: The light at the end of the Intelligent Software Products, Inc. tunnel may be an oncoming dragon 19 Virginia Ave. ...uunet!ispi!jbayer Rockville Centre, NY 11570 (516) 766-2867 jbayer@ispi.UUCP