[ILUG] Re: Keymappings (I think)

John P. Looney jplooney at compapp.dcu.ie
Wed Jun 30 17:20:15 IST 1999


On Wed, Jun 30, 1999 at 03:50:30PM +0100, Liam Bedford mentioned:
> I just noticed something. I'm running mandrake with KDE at the moment.
> When I run netscape, the Wheel works (scrolls up and down). If I turn
> on Num Lock, it doesn't. If I turn Num Lock off again, it starts working
> again. Anyone got any ideas? I had thought it was just netscape forgetting
> that the mouse should scroll (it does that as well sometimes).
 
 That's just a shitty application. In X, the num lock being down is stored
in the "state" part of an XEvent struct. Most applications look for
something like:

 if(event.xbutton.key==Button_1 && event->state==XK_Shift) {
    you got a shift-click
 } else if (event.xbutton.key==Button_4 && event->state==0) {
    you got a scroll down
 }

 The correct thing to do would be something like 

 } else if (event.xbutton.key==Button_4 && (!(event->state & XK_Ctrl))) {

 if you wanted to make sure that you don't do stuff when ctrl is pressed.

 FVWM used to have this sort of bug a lot, as does xspim.

Kate

-- 
Microsoft - the best reason in the world to drink beer




More information about the ILUG mailing list