On Sat, 15 Jun 2002, John Levon wrote: > Anyway, I don't understand how the old code worked very well either. > Feel lucky that I cleaned it up a while ago :)) > > If there is some obscure bit of kb*.[hC] ... I /might/ know the answer; > there's no harm in asking !
OK, we have a plan now. We have introduced a LyXKeySym class, which is a 1-for-1 replacement for the X11 KeySym. This class provides the functionality from XLookupString, XStringToKeySym and all that good stuff. So, in the first step, we will introduce this class to clear out all of the uses of the X11 KeySym in the main files. We know this class will be X11 specific at this point. However, the good news is that it will be much easier for you to reimplement a Qt-specific version of this class later. The only X11-specific point in the interface is a constructor that XForms uses to construct the KeySym in the keypress handler, and we will probably abstract that away when the introduction of this class is complete. Then, you just have to replace this with the corresponding Qt mechanism. The point is that the LyX core only needs this functionality from the KeySym: - Storage in a vector, in the kb_sequence class - Equality comparision in the kb_sequence and kb_map classes - Construction for a symbolic name in the kb_map::parse method - Conversion to a local ISO encoding for entry into the text - Presentation as a symbolic name, in the kb_map/kb_sequence classes So, this is what the class provides. Nothing more, nothing less. Greets, Asger