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

[wmx] num-lock fix for wmx

henri - Thu Oct 21 09:57:39 1999


hey,

needed a change of pace, so i did a bit more hacking...

ever get anoyed that the keyboard commands don't work if the num-lock
key is pressed? i sure did...

there is more info after the code segments of this email [gnome patch
etc.]

behold the hack: 

[note, this has only been tested on my home RH6.0 linux box w/ a
windows keyboard, I would love to hear if works for anyone else]

[second note, i am still diff-challanged... so you are going to have
to edit Client.C by hand or download the 6pre1+gnome tarball]


change 
--------------------
		XGrabKey(display(), keycode,
			 CONFIG_ALT_KEY_MASK, m_window, True,
			 GrabModeAsync, GrabModeAsync);
--------------------
at line 184 (in Client::manage)

to
--------------------
		XGrabKey(display(), keycode,
			 CONFIG_ALT_KEY_MASK|LockMask|Mod2Mask,
			 m_window, True,
			 GrabModeAsync, GrabModeAsync);
		XGrabKey(display(), keycode,
			 CONFIG_ALT_KEY_MASK|LockMask,
			 m_window, True,
			 GrabModeAsync, GrabModeAsync);
		XGrabKey(display(), keycode,
			 CONFIG_ALT_KEY_MASK|Mod2Mask,
			 m_window, True,
			 GrabModeAsync, GrabModeAsync);
		XGrabKey(display(), keycode,
			 CONFIG_ALT_KEY_MASK,
			 m_window, True,
			 GrabModeAsync, GrabModeAsync);
---------------------

arg, what a hack.. but it works.

you will also want to change the next three
-----------------
	    XGrabKey(display(), keycode, 0, m_window, True,
		     GrabModeAsync, GrabModeAsync);
-----------------

 to
-----------------
	    XGrabKey(display(), keycode, AnyModifier, m_window, True,
		     GrabModeAsync, GrabModeAsync);
-----------------

basically change the 0 to AnyModifier

if you use the CONFIG_QUICK*_KEY stuff.

If the caps-lock works, but the num-lock doesn't then please send me
the following info:

run:

xev

make sure that the window that popped up has focus (you should see a
stream of stuff at the command line)

once it has focus make sure that none of the other modifiers are on
(scroll-lock, etc) and while making sure that no other keys are being
pressed and the mouse isn't moving etc..

click on the num-lock key

you should get something like this in the xterm where you launched xev
from:
-----------------
KeyRelease event, serial 22, synthetic NO, window 0x6c00001,
    root 0x47, subw 0x6c00002, time 4189140064, (16,39), root:(100,871),
    state 0x10, keycode 77 (keysym 0xff7f, Num_Lock), same_screen YES,
    XLookupString gives 0 characters:  ""
-----------------

the only thing that i care about is the 

"state 0x10" part, if the value after state is different then please
email me your systems info and i'll see what i can do.



henri




- side note: i put up a tarball for wmx-6pre1 + gnome at
http://www.nidal.com/~henri/wmx the tarball and patch both have the
above fix.



- another side note: if you are using GNOME, i would recomend
upgrading to the latest stable stuff and using the "Tasklist" applet
instead of the "Pager" applet. it seems to be faster. [i use both, the
Pager still works well for the channels and the Tasklist works well
for the running apps]


Next: