lynx-dev
[Top][All Lists]
Advanced

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

lynx-dev Changing the keymap code


From: Doug Kaufman
Subject: lynx-dev Changing the keymap code
Date: Fri, 5 Feb 1999 21:03:56 -0800 (PST)

I would plead with those proposing changes in the keymap code to do it
carefully, since some of the recent patches are very likely to break
the coding for DOS. Specifically, please do not INSERT a key into the
mapping, as this will change all the mappings above.

Since I did the patch that expanded the keymap[] array in LYKeymap.c
with the #ifdefs to make it work for the different types of build
under DOS, I will try to explain what I did as best as I understand
it. Please remember that I am NOT a programmer. The SLANG, DJGPP, and
PDCURSES codes all assign values to some of the keystroke combinations
on the PC keyboard which do not have standard ANSI values. Keypresses
are determined from the BIOS, so these assignments apply primarily
to single user systems. The three sets of software, however, choose
different sets of keys from which to make assignments, and the
assignments are not compatible with each other. I extracted the
assignment codes from the source code of the respective programs and
put them in the files pdcurses.key, slang.key, and djgpp.key which now
accompany the lynx distribution. These key combinations (e.g. ALT-X)
can now be assigned or reassigned via the KEYMAP method in lynx.cfg.
Default mappings were incorporated, so that ALT-X is ABORT and F1 is
HELP, etc., for each of the different sets of key assignment. KEYMAP
in lynx.cfg accepts the hex values for the keys as specified in the
appropriate *.key file. keymap[] was expanded just enough to accept
the highest value assigned by any of the three potential DOS mappings.
If anyone ADDS a key into the keymap[] array, this will shift the
preassigned key values above it and make all the default mappings
wrong.

Nothing in the keymap structure should be specific for DOS. Several
months ago there were messages from someone who wanted to do
arbitrary reassignments (I think on Linux). At that point the code
in LYStrings.c was changed to allow this on non-DOS machines. May I
suggest that if new mappings are needed that they either be added to
the keymap[] at the end, increasing its size, or be substituted for a
mapping now unused.

Lloyd Rasmussen asked recently about keymapping in the Win32 port of
lynx. If this was built with PDCurses, I would think that this could
be done. Has anyone who uses the Win32 port actually tried to do a
keymapping of one of the non-ANSI key combinations?

Sorry if some of this isn't very clear. I'll try to review what I did
if anyone has questions about it.
                             Doug
__
Doug Kaufman
Internet: address@hidden (preferred)
          address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]