And there were other benefits:
There is no need for x.widget_name. It's a faux helper. Perhaps "faux wrapper" is a better term. Recent work shows that Leo's Qt code can just test x.objectName! This seems like a nit, but it isn't.
Recent work shows that the console gui
does call
LeoKeyEvent.__init__, but only with w as a QTextMixin object. As you can see from PR
#4649 (the latest bug fix PR), the test for
QTextMixin is done early, so later complications and tests should have no effect on the console gui. In other words, the LeoKeyEvent class is a perfect wrapper class for keystrokes!
Yes, LeoKeyEvent.__init__ will differ between PRs
#4649 and PR
#4646, but the resulting merge conflict should be easy to manage. More positively, PR #4646 has been guiding my thinking while fixing the immediate bugs.
Edward