APLawrence - Information and Resources for Unix and Linux Systems, Bloggers and the self-employed
RSS Feeds Get APLawrence.com by RSS











(OLDER) <- More Stuff -> (NEWER) (NEWEST)
Home > News Posts > panner num-lock on-off ––>Re: Panner: Num Lock (on/off)problem
Printer Friendly Version




News Group Posts

panner num-lock on-off



From: Jean-Pierre Radley <jpr@jpr.com>
Subject: Re: Panner: Num Lock (on/off) problem
Date: Tue, 23 Jan 2001 16:48:07 GMT
References: <3A6DACBF.98639597@inetmail.att.net> 

Shery Corgan propounded (on Tue, Jan 23, 2001 at 04:05:28PM +0000):
| Using SCO OS Unix 5.0.5 and Filepro 4.8
| Using GUI -- Panner
| 
| I perform 90 % of my tasks using the SCO Panner.
| The different windows need the num_lock on or off
| depending on the window.
| 
| I would like to have the num_lock on or off to get
| the calculator keys to work, but not both. I can not
| find any documentation on this problem.
| 
| What happens now, by panner window, to get
| numbers from the calculator_keys
| 
| window_1    on
| window_2    off
| window_3    on
| window_4    off
| window_5    on
| window_6    on
| window_7    on
| window_8    on
| window_9    on
| 
| Before accessing Filepro Main Menu (dpromenu)
| I set the terminal type using a small script (on each
| panner window) as follows.
| 
| term_script
| 
| setcolor hi_white blue
| setcolor -r magenta gray
| TERM=ansi;export TERM

You shouldn't need to do that.  I set the colors for my windows in my
.startxc file; If your filePro termcap file doesn't have scoansi in, it,
just add it to the asni entry.


  # /u/jpr/.startxrc
  #Oct 97: my ~/.Xdefaults file sets the following:
  #     font4 as default
  #     no menubar on start
  #     blinking cursor
  #     scrollBar
  #     mapchanAutomap False
  
  # following file kills existing netscape and locks, relaunches netscape
  /u/jpr/bin/ns
  
  xclock -update 1 -hd magenta -hl magenta -geometry 100x100+0+1019 &
  
  scoterm -fg cyan   -bg black  -n JPR  -title jpr  -geometry 80x47+0+0 &
  
  scoterm -fg magenta -bg white -n JPR  -title jpr  -geometry 80x47+85+67 &
  
  scoterm -fg yellow -bg blue   -n JPR  -title jpr  -geometry 80x47+764+224 &
  
  scoterm -fg blue   -bg gray   -n BOSS -title boss -geometry 80x47+1600+0 \
          -e su - boss &
  
  scoterm -fg green  -bg black  -n BOSS -title boss -geometry 80x47+1800+120 \
          -e su - boss &
  
  scoterm -fg black  -bg white  -n BOSS -title boss -geometry 80x47+2364+224 \
          -e su - boss &
  
  scoterm -fg white  -bg red    -n UUCP -title uucp -geometry 80x47+3200+0 \
          -e su - uucp &
  
  scoterm -fg red    -bg cyan   -n NEWS -title news -geometry 80x47+3964+224 \
          -e su - news &
  
  scoterm -fg red  -bg gray     -n APPL -title appl -geometry 80x47+4800+0 \
          -e su - appl &
  
  scoterm -fg blue  -bg gray    -n APPL -title appl -geometry 80x25+5564+126 \
          -e su - appl &
  
  scoterm -fg black  -bg gray   -n APPL -title appl -geometry 80x25+5564+665 \
          -e su - appl &
  
  win &
  
  xv -root -rmode 5 -rbg "#107090" -quit /u/jpr/lib/valerie.jpeg &
  
  exec pmwm



As for the LEDs settings, here's a short program; I run it from
/etc/rc.d, but you could of course fire it off differently for each
window.


/*
     This code has been initially contributed by Jim Woolley of S Levy Inc. ;
it has been modified by Benoit Bruet (100321.1407@compuserve.com) to use
system console instead of standard input, to set any led combination passed
from command line, and to output previous settings.

Purpose :
=========

     "setleds" allows anybody having read access to "/dev/console"
(usually superuser) to light up any combination of "Caps Locks", "Num Lock",
"Scroll Lock" LED's of the console keyboard. Its primary use is to have the
"Num Lock" LED lit as it is usual in PC/MS-DOS world. This should avoid some
trouble to system manager with users complaining to be unable to log at
console after a reboot when entering figures of their password at keyboard
keypad.

Instructions :
==============

     "setleds" takes an optional argument. When present, this argument should
range from 0 to 7, and is obtained by OR-ing the following values :

          1 to light "Scroll Lock",
          2 to light "Num Lock",
          4 to light "Caps Lock".

     For instance, 7 would mean "all LED's on", 0 whould mean "all LED's off"
and 2 would mean only "Num Lock" LED on.

     Whether it has an argument or not, "setleds" will return the previous
settings (0 at boot), which can be used for later restoration. If output is
unwanted, it should be redirected to /dev/null.

     To have "Num Lock" LED lit at boot while discarding previous settings (0),
simply insert the following command as part of the boot process (for instance
in /etc/rc)  :

     setleds 2 >/dev/null

Warning :
=========

     There is not kind of guarantee, either expressed or implied, with this
software, which is delivered on a "as is" basis only.

*/
# include <ctype.h>
# include <fcntl.h>
# include <stdio.h>
# include <sys/types.h>
# include <sys/ioctl.h>
# include <sys/vtkd.h>

int main(int argc,char *argv[])
{
   int console,rc ;
   char leds ;

   rc = 1 ;
   if(argc>1 && !isdigit(argv[1][0]))
   {
      fprintf(stderr,"usage: setleds [ 0-7 ] # OR-ed LEDs bits\n") ;
   }
   else
   {
      console = open("/dev/console",0) ;
      if(console<0) perror("/dev/console") ;
      else
      {
         if(ioctl(console,KDGETLED,&leds)<0) perror("ioctl") ;
         else
         {
           printf("%d\n",leds) ;
           if(argc>1)
           {
              if(ioctl(console,KDSETLED,atoi(argv[1])&7)<0) perror("ioctl") ;
              else rc = 0 ;
           }
           else rc = 0 ;
         }
      }
   }
   return(rc) ;
}

-- 
JP


If this page was useful to you, please click to help others find it:  

Your +1's can help friends, contacts, and others on the web find the best stuff when they search.

Comments?



Click here to add your comments



Don't miss responses! Subscribe to Comments by RSS or by Email

Click here to add your comments


If you want a picture to show with your comment, go get a Gravatar



Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.

Publishing your articles here

Jump to Comments



Many of the products and books I review are things I purchased for my own use. Some were given to me specifically for the purpose of reviewing them. I resell or can earn commissions from the sale of some of these items. Links within these pages may be affiliate links that pay me for referring you to them. That's mostly insignificant amounts of money; whenever it is not I have made my relationship plain. I also may own stock in companies mentioned here. If you have any question, please do feel free to contact me.

Specific links that take you to pages that allow you to purchase the item I reviewed are very likely to pay me a commission. Many of the books I review were given to me by the publishers specifically for the purpose of writing a review. These gifts and referral fees do not affect my opinions; I often give bad reviews anyway.

We use Google third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here.

g_face.jpg

This post tagged:

       - Filepro
       - SCO_OSR5




Unix/Linux Consultants

Skills Tests

Guest Post Here