event is used like this in moveToHelper:
w = event.w if event else None
if not g.isTextWrapper(w):
return
Because of Python's duck typing, any object that has a w property is going to work. w is supposed to be the wrapper for the editor you are using. For the body editor, this is
body = c.frame.body # LeoQtBody
wrapper = body.wrapper # QTextEditWrapper
Or you could create an actual event using c and any values for the other args:
event = LeoKeyEvent(
c, binding=binding, char=char, w=w, x=x, y=y, x_root=x_root, y_root=y_root
)
If you create the event this way and do not specify w, it will be computed for you using whatever object has the focus.