Minor changes in the key database



Hello!

It is now safe to define many sequences to the same key.  "Learn Keys"
does not provide the interface to this feature (and probably it should
not), but it's now used in mc.lib:

home=\e[1~
home=\e[7~
end=\e[4~
end=\e[8~

Those definitions make it possible to use Home and End keys in MC running
in xterm and rxvt even if they both set "TERM=xterm" and use different
keys.  The best part - "Learn Keys" is not required to make them work.

Don't tell me that MC should not be doing that - this workaround (i.e.
MC's own terminal database in mc.lib) existed for years, but now it's a
workaround that works out of box on many systems.

Another change makes it impossible to define a key sequence which is a
subsequence of another sequence.  MC would go crazy and stop recognizing
Escape if user tried to use e.g. Alt-[ in the "Learn Keys" dialog.  In
fact, the base node of the key database would be set to 0, thus disabling
the whole database. Now such sequences are rejected.

Another case when it can happen - "Learn Keys" asks for some key, e.g. F8.
The user presses F8 twice too fast for MC to distinguish.  Then the user
tries to redefine F8 as a single F8.  The old code would do crazy.  The
new code would reject the new sequence.  It's not ideal, but it's _much_
better than corrupting the key database, when even "Esc 0" stops working
and you cannot exit.

Enjoy.

-- 
Regards,
Pavel Roskin





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