On Thu, May 13, 2010 at 4:07 PM, tfer <[email protected]> wrote: >> Same should apply for e.g. minibuffer. It should just "sit there" as >> QLineEdit. If you press "a" in the minibuffer Leo should never know >> about it, it should just result in "a" appearing in the line editor. >> > Well, I still really like the ability to put a hook in between the > keypress and the printing into what ever widget is the target, there > is just too much interesting things that makes doable that a strict > lock-in would make impossible.
This comment is perceptive. The keyHandlerClass, and its methods k.getArgs and k.masterKeyHandler are that hook. True, every part of leoKeys.py is complicated, but from a design standpoint that complication is unimportant: the gui "simply" needs to call k.masterKeyHandler. As the qt gui (leoKeyEvent) shows, it is actually not easy to determine what key has been pressed, but that does *not* complicate the design, it merely complicates the qt gui, which *must* have the responsibility of synthesizing the keystroke. We will soon see the benefits of the proper separation of key-handling responsibilities: 1. I'll make major revisions to leoKeys without (much) affecting any other part of Leo. 2. I'll attempt to simplify the (presently-too-complex) tangle of concepts behind the notion of "canonical key binding". I hope that this will help simplify the code that synthesizes the keystroke in leoKeyEvent. Because key binding is properly encapsulated, both of these projects are largely independent of each other. True, the notion of what a key event *is* forms a connection between leoKeyEvent and leoKeys.py, but that can not be helped and it is, in a real sense, the minimal connection that can be imagined. Edward -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/leo-editor?hl=en.
