You are not logged in.
Pages: 1
heres something i've been using and thought someone else might use. It's a little c program to set the number lock at boot.
copy this code and rename it xsetnumlock.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;
}
I got the code from here http://portal.suse.com/sdb/en/2001/01/c … mlock.html
heres the pkgbuild, its the first one i've made like this and wasnt sure how to do it, but it works for me.
pkgname=xsetnumlock
pkgver=1.0
pkgrel=1
pkgdesc="A program to set you number lock"
depends=('gcc')
source=(xsetnumlock.c)
build() {
mkdir -p $startdir/pkg/usr/bin
gcc -I/usr/X11R6/include -L/usr/X11R6/lib -o xsetnumlock
xsetnumlock.c -lX11 -lXtst
chown root:root xsetnumlock
cp $startdir/src/xsetnumlock $startdir/pkg/usr/bin
chmod 0755 xsetnumlock
}
Add "xsetnumlock &" to your ~/.xinitrc
Offline
good, but...
[pigi@localhost ~]$ pacman -Ss numlockx
extra/numlockx 1.0-2
numlockx is a simple program that turns on the numlock key while you are in
X Windows
Offline
This program does the same thing and is 5000 times smaller than that kde one. but i guess it doesnt really matter.
i just posted it cause its such a small simple program, and useful for people like me that always forget to hit num lock.
Offline
Offline
http://ktown.kde.org/~seli/numlockx/numlockx-1.0.tar.gz
Its a kde url, and i've read somewhere else that it was from kde too. what i use is just the simplest solution i could find for what it does.
Offline
Pages: 1