Path: utzoo!utgpu!attcan!uunet!ingr!myoung From: myoung@ingr.UUCP (Mark Young) Newsgroups: comp.windows.x Subject: Re: twm 4.0 grabbing all keys Summary: Possible pointer to the problem. Message-ID: <2880@ingr.UUCP> Date: 9 Nov 88 20:02:09 GMT References: <2593@uhccux.uhcc.hawaii.edu> Organization: Intergraph Corp. Huntsville, Al Lines: 38 In article <2593@uhccux.uhcc.hawaii.edu>, xacct@uhccux.uhcc.hawaii.edu (X-Windows Account) writes: > > Running twm 4.0, the version that appeared in comp.sources.x in > September, under R2, SunOs 3.5, I find I cannot type into a window. > Keys are pressed -- nothing happens. > > Greg, lee@uhccux.uhcc.hawaii.edu I tracked down a problem like this with our twm, xterm and server. It seemed as though keystrokes were heading for the bitbucket. I localized the problem down the .twmrc file. It was that I had line like: "Clear" = : window : f.winrefresh when twm would parse this line, it would request the keysym and keycode for the "Clear" key. Unfortunatly, when I had defined the keytab for the server, I didn't define any key as the "Clear" key. In menus.c, the function AddFuncKey() calls XStringToKeysym() to get the keysym from from the string "Clear". I think that you get a good keysym, but when you call XKeysymToKeycode() a few lines down, since there is no keycode associated with the keysym, you get a zero back. Later, twm calls GrabKeys() which in turn calls XGrabKey() passing a zero as the keycode to grab. The problem is that XGrabKey() accepts 0 (#define AnyKey 0L) to be an indication that you want to grab all of the keys. Oops. I didn't have the time to try and come up with a patch for this nasty. Any takers. I guess I can go back and try if even Tom doesn't want to take a stab at it ;-). ...m (easier to find than fix) young --- ingr!myoung!myoung@uunet.uu.net | mark allan young | where {uunet,ihnp4}!ingr!myoung!myoung | intergraph corp, cr1105 | do I | one madison industrial pk | put the "Ask me about our Intergraph | huntsville, al 35807 | usual CLIPPER-based Workstations." | (205) 772-6094 | disclaimer