----- Original Message ----- 
From: pete moss <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, August 16, 1999 9:29 PM
Subject: [newbie] num lock


> i know this is minor, but does anyone know how to make the num lock
> activate automatically when i boot kde?
> 

You would think this is trivial, but no one seems able to accomplish it, at least that 
I have found. I used to use a small utility in the old DOS 1.x days to do this until 
DOS allowed the bios to control this setting and Windows keeps the same state when it 
started. Why can't Linux/KDE do this?

The setleds command was used (in Mandrake 5.3) to turn on numlock for the bash shell, 
but starting kde would turn it back off. It is in Mandrake 6.0 also. It may need to be 
uncommented, I'm not certain. It is similar to what is in the Linux FAQ.

>From Mandrake 5.3 and 6.0  /etc/rc.d/rc.system:

# Linux Mandrake : this little script switch on the LEDs
# in console mode

INITTY=/dev/tty[1-8]
for tty in $INITTY; do
        setleds -D +num < $tty
 done


There is an interesting section in /etc/XF86Config:

    # Let the server do the NumLock processing.  This should only be 
    # required when using pre-R6 clients
    #ServerNumLock

    # Specify which keyboard LEDs can be user-controlled (eg, with xset(1))
    #Xleds      1 2 3

But as you can see, it is commented out. 
http://amelia.db.erau.edu/ldp/HOWTO/Config-HOWTO-3.html contains the following advice:

"We have seen above how to make a few special keys work. The sample file .Xmodmap 
works well if you want to use Xjed, but it makes the keypad unusable. You'll then need 
another config file, which we'll call .Xmodmap.num: 


! Definitions can be found in <X11/keysymdef.h>

keycode 77  = Num_Lock
keycode 112 = KP_Divide
keycode 63  = KP_Multiply
keycode 82  = KP_Subtract
keycode 86  = KP_Add
keycode 79  = KP_7
keycode 80  = KP_8
keycode 81  = KP_9
keycode 83  = KP_4
keycode 84  = KP_5
keycode 85  = KP_6
keycode 87  = KP_1
keycode 88  = KP_2
keycode 89  = KP_3
keycode 90  = KP_0
keycode 91  = KP_Decimal

Make sure that your /etc/X11/XF86Config does not contain these three lines: 


  ServerNumLock
  Xleds
  XkbDisable

and in case, comment them out. To re-enable the keypad, you'll issue the command 
xmodmap .Xmodmap.num." 

This explains why it is comment out, but does not tell us how to do what we want.

>From http://www.xfree86.org/man/XF86Conf.html  :

"XLeds led ...
makes led available for clients instead of using the traditional function (Scroll 
Lock, Caps Lock & Num Lock). led is a list of numbers in the range 1 to 3."

And from http://www.itlibrary.com/reference/library/0672308509/lsg05.htm  :

"In theory, you can use the Xleds setting to permit programming of the LED buttons on 
most keyboards (for Num Lock, Caps Lock, and Scroll Lock). Leave it commented as the 
LEDs are not used for much user feedback. "

This site _might_ have something, but I am at a language disadvantage: 
http://dione.ids.pl/~pborys/xfaq/xfaq.html

This may be of some help: 
http://amelia.db.erau.edu/ldp/HOWTO/Keyboard-and-Console-HOWTO-10.html
, but probably not, and finally, from 
http://amelia.db.erau.edu/ldp/FAQ/Linux-FAQ-7.html

"7.10 How do I get NUM LOCK to default to on? 
Use the setleds program, for example (in /etc/rc.local or one of the /etc/rc.d/* 
files): 

for t in 1 2 3 4 5 6 7 8
do
    setleds +num < /dev/tty$t > /dev/null
done

Setleds is part of the kbd package (`` How do I remap my keyboard to UK, French, etc.? 
''). 
Alternatively, patch your kernel. You need to arrange for KBD_DEFLEDS to be defined to 
(1 << VC_NUMLOCK) when compiling drivers/char/keyboard.c. "

I assume that the latter accomplishes in th ekernel the same thing the shell script 
does, but I haven't tried it to see if 1) it works and 2) the "numlock on" state 
survives starting kde.

So, in conclusion, it _is_ trivial to turn on numlock for the terminal windows, but 
not to keep the numlock state or set it automatically when starting KDE.


So with all that Linux can accomplish, why not this? What have I missed?

Hoyt




Reply via email to