broken keyboard configuration

From: Ben Crowell (see_at_my.sig)
Date: 02/28/04


Date: Sat, 28 Feb 2004 10:38:51 -0800

I posted about this problem previously, but now I've collected more data, so
I'm hoping now someone will be able to give me a suggestion. Sometime last
month, I noticed that my keyboard's configuration seemed to have gotten
messed up. The symptom is that most terminal-based programs are getting the
wrong character when I type certain things on the keyboard. For instance,
if I type a '(' character, i.e., shift-9, the program backspaces instead.
This did not start happening until long after I installed FreeBSD 4.8. I'm
not sure what triggered it, but I assume it was either because I upgraded a
library somewhere or because a config file somewhere is messed up. It's not
a hardware problem, because it's occurring on two out of my three FreeBSD
boxes. The fact that it's occurring on two different machines would also
seem to show that it's not just a problem arising from a damaged file
system. Here is a simple test program that produces the bad behavior on my
systems:

  #include <stdio.h>

  main() {
    int n;
    scanf("%d",&n);
    printf("n=%d\n",n);
  }

If I run this program and type '37(', what appears on the screen is this:
  3
  n=3
The 7 disappears after I type the (, and the ( never appears.

The problem seems to be occurring with anything that uses stdio, including
the cat utility and the Perl interpreter. It only occurs with the keyboard,
so for instance, if I do % cat >a.a, and type some stuff, left parens get
treated as backspaces. However, if I do % cat <a.a >b.b, left parens in a.a
are correctly copied into b.b. The problem does not occur with GUI apps,
and it also doesn't occur with some terminal-based apps, e.g., Emacs.
Presumably this is because these other apps use some other library, e.g.,
the GNU readline library. It occurs regardless of which terminal program
I'm using, e.g., xterm or aterm.

Any suggestions on how to fix this would be much appreciated!!

-- 
e-mail info: http://www.lightandmatter.com/area4author.html


Relevant Pages