Re: Num lock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Nov 21, 2003 at 10:55:47PM -0800, redhat wrote:
> 
> ----- Original Message ----- 
> From: "Brian T. Brunner" <brian.t.brunner@xxxxxxxxxxxxxxx>
> To: <shrike-list@xxxxxxxxxx>
> Sent: Friday 21 November 2003 10:43
> Subject: Re: Num lock
> 
> 
> >
> > I lose my mouse frequently (I switch back & forth from
> > RH7.3 <=> Win2K) using an OmniViewSE 4-port switch.
> >
> > <alt><tab> brings up a terminal window, and kudzu finds my mouse.
> > If <alt><tab> brings up and editor (vi) then :!kudzu finds my mouse.
> >
> > That said, losing my mouse is annoying.  At home I removed
> > the capslock key with a screwdriver, and it stopped giving me grief.
> >
> > Brian Brunner
> > brian.t.brunner@xxxxxxxxxxxxxxx
> > (610)796-5838
> >
> > >>> mahoover@xxxxxxxxxxxxxxxx 11/21/03 09:23AM >>>
> > --__--__--
> > From: "redhat" <redhat@xxxxxxxxxx>
> >
> > >Where do I make the change to settings to always turn the NUM LOCK key
> > >on?
> >
> > Personally, I'd be happy to be able to turn on Caps Lock, Num Lock, or
> > Scroll Lock without it disabling the mouse on me.
> >
> > If I should have any of the above keys on just for a second the mouse goes
> dead on me.  If I'm lucky, I can switch to a terminal window and issue a
> /etc/rc.d/init.d/gpm restart and get the mouse back.  Otherwise I have to
> Ctrl-Alt-Backspace the X-server and lose anything I might have open.
> 
> 
> 
> I've had no problems with losing my mouse at all.  However, someone
> mentioned using KDE > something > Keyboard
> (I'm in windows right now)
> Anyway, the keyboard option only asks me for the generic keyboard type
> (English, etc) there are no options for any individual keys.  I'm still
> looking for a way to set it on.  A configuration file or something.
> 
> - - - - -
> I want to have three cats named Fred:
> 
> Deep Fred
> French Fred
> Stir Fred
> 
> Lokrin (TechAss)
> Technical Assailant
> http://lokrin.net
>  - - - -
> 
> 
> 
> ---
> Outgoing male is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.536 / Virus Database: 331 - Release Date: 03/11/03
---end quoted text---

I don't know if this has been addressed or not, but here is how to
start numlock on the consoles and in X.  Should work with any window
manager. 

To turn numlock on in console...

echo -n "Turning on numlock ... "
  for tty in /dev/tty[1-6] /dev/tty1[2]; do
    setleds -D +num < $tty &
  done
echo "done "

Call the above from /etc/rc.d/rc.local (i think will work?)

When X starts it will turn the numlock off, so you need a different
program to turn it on...

//Numlock.c
#include <X11/extensions/XTest.h>
#include <X11/keysym.h>
 
int main(void) {
        Display* disp = XOpenDisplay( NULL );
        if( disp == NULL )
                return 1;
        XTestFakeKeyEvent( disp, XKeysymToKeycode( disp, XK_Num_Lock),
        True, CurrentTime );
        XTestFakeKeyEvent( disp, XKeysymToKeycode( disp, XK_Num_Lock),
        False, CurrentTime );
        XCloseDisplay( disp );
        return 0;
}

// RH 9.0 compile with:
// gcc -I/usr/X11R6/include -L/usr/X11R6/lib -o numlock Numlock.c
-lX11 -lXtst

Now as root copy the program to /usr/local/bin:
cp numlock /usr/local/bin/ && chmod 755 /usr/local/bin/numlock

To make it work, as root do:
vi /etc/X11/xinit/xinitrc.d/xnumlock

#!/bin/sh
if [ -x /usr/local/bin/numlock ]; then
  /usr/local/bin/numlock
fi

# paste the above into the file 
# /etc/X11/xinit/xinitrc.d/xnumlock
# then...
# chmod 755 /etc/X11/xinit/xinitrc.d/xnumlock

# Exit out of X and restart.

# credit goes to SUSE, not me.

Note that I do not use gdm and I login to console, then startx& to
start X!

Works for me, but I think people have many problem with numlock and
mouse.


jay


-- 
Shrike-list mailing list
Shrike-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/shrike-list

[Index of Archives]     [Fedora Users]     [Centos Users]     [Kernel Development]     [Red Hat Install]     [Red Hat Watch]     [Red Hat Development]     [Red Hat Phoebe Beta]     [Yosemite Forum]     [Fedora Discussion]     [Gimp]     [Stuff]     [Yosemite News]

  Powered by Linux