Problem
The behaviour of the Console NumLock is not the same on OpenServer 6.0.0 as on OpenServer 5.
On OpenServer 6 is it off by default and even if you switch it on, it will be switched off again the next time you log out of your console session.
Solution
One way to workaround this issue is to control the behaviour of the NumLock (and ScrollLock and CapsLock) key using the following sample source.
The following binary is available from:ftp://ftpput.sco.com/tmp/lockkeys.tar.ZAlternatively, you may wish to build this binary yourself and this detailed below.
Note you will need to have the OpenServer 6.0.0 development system installed on your OpenServer 6.0.0 system to build this source.
To use this program to set <NumLock> on on your current console screen, the command is:
lockkeys numlock onTo modify the <NUMLOCK> setting on any other console screen, simply use:
lockkeys numlock on < /dev/ttyXXwith XX ranging from 01 .. 12.
To set <NumLock> on when you login into the console simply add the command above to your $HOME/.profile.
You can also run the command with the "capslock" entry too.
---------------------<cut here>------------------------
/*
* Program to control the console lock keys states
*
* Build with "cc -Kosr -o lockkeys lockkeys.c"
*/
#include <stdio.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/vtkd.h>#define RDFD 0
#define CAPSLOCK 0x04
#define NUMLOCK 0x02
#define SCROLLLOCK 0x01void main( argc, argv ) int argc; char *argv[]; { char c; int function, key;
if ( argc != 3 ) {
fprintf( stderr, "Usage: lockkeys key on | off | toggle\n" );
exit( 1 );
}if ( !strcmp( argv[2], "off" )) function=0; else if ( !strcmp( argv[2], "on" )) function=1; else if ( !strcmp( argv[2], "toggle" )) function=2; else { fprintf( stderr, "lockkeys: function must be on, off, or toggle\n" ); exit( 1 ); }
if ( !strcmp( argv[1], "numlock" )) key=NUMLOCK; else if ( !strcmp( argv[1], "capslock" )) key=CAPSLOCK; else if ( !strcmp( argv[1], "scrolllock" )) key=SCROLLLOCK; else { fprintf( stderr, "lockkeys: key must be numlock, capslock, or scrolllock\n" ); exit( 1 ); }
if ( ioctl( RDFD, KDGETLED, &c ) != 0 ) {
perror( "lockkeys: can't get current lock state" );
exit( 2 );
}
if ( function == 0 )
c &= ~key;
else if ( function == 1 )
c |= key;
else
c ^= key;
if ( ioctl( RDFD, KDSETLED, c ) != 0 ) {
perror( "lockkeys: error setting lock state" );
exit( 2 );
}
exit( 0 );
}
---------------------<cut here>------------------------