On Fri, May 15, 2020 at 9:39 AM Edward K. Ream <[email protected]> wrote:
[...]

> Here I'll start making the plan more specific. Let's start with the
> following pseudo code, for a new KeyHandlerClass method:
>
>
> def handle_binding(self, event):
>     """Handle the given key event."""
>     # Use per-state bindings if they exists.
>     binding, func = event.binding, None
>     if state:
>         d = self.state_dict.get(self.state)
>         func = d.get(binding) or d.get('default')
>     # Otherwise, use per-window bindings.
>     if not func:
>         d = self.window_dict.get(event.window)
>         func = d.get(binding) or d.get('default')
>     return func(binding, char)
>

Could you give some examples of various kinds of 'func' and the things they
will do? I can think of two likely flavors. One which performs an actual
action (insert-node, end-of-line, find-next, etc). Another which mainly
just changes self.state. Am I on the right track?

Brian

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAO5X8CzZ6Okr%3Dq%2BwEgCV5uKVT6vmvJMssSMwiRd8bB%2B1QJrjsA%40mail.gmail.com.

Reply via email to