I'm reviving a source build of an old Xt/Motif application that hasn't been worked on in years, and last built successfully on 32bit Red Hat 4. I have it mostly building and running on 64-bit Red Hat 5. There's just one significant problem with the application...it doesn't respond to most of the keyboard input that it's supposed to. None of the menu accelerators work, nor do many of the other modified and unmodified keypresses that are supposed to support specific functions. The only keystrokes the app recognizes are entry into text entry fields and arrow key navigation开发者_JAVA技巧 across widgets with rows/colums of data.
I though this might simply be due to bad application code, but then something strange happened....all the keys started to work! I have no idea what I did to cause this to happen. I was just studying the code by running it in the debugger, and the app started responding to keyboard intput. At this point, I tried running without the debugger, and the keys still worked. I then tried running an older build that had also exhibited the problem, and that build worked as well.
I copied these same executables over to another Centos 5 machine, and over there, the keys still didn't work. I spent a bunch of time looking at the two environments, but couldn't figure out what was different between the two. Then I restarted my machine (the machine on which the app magically worked), and now the keys no longer work on that machine either. Nothing I can think to do will cause keypresses to once again be recognized.
So obviously, this problem is at least somewhat environmental. Can anyone provide any clue as to what is going on here? What changed in my environment to cause the application to temporarily start behaving correctly? I'm hoping there's some Xt/Motif guru out there that might know what's happening here.
It could be "numlock". Really. It's treated as a modifier in many recent X11 setups, and if it's on, the app will get key+modifier, and quite possibly treat it differently.
I would look into your keybindings and xmodmap.
(Been a long time since I had to go after that sort of thing.)
I cannot think as to why it would "snap-in" like you describe; but perhaps your old app is/was doing some kind of override in-memory, or something like that.
It seems possible that could then persist after the app was closed; and perhaps some thing was triggered in the debugger that does not happen at runtime due to some other condition.
Good Luck
精彩评论