candera / khordr

A keyboard chording application: supercharge your typing by pressing more than one key at once.
34 stars 3 forks source link

Write a delegating handler #5

Open candera opened 11 years ago

candera commented 11 years ago

It would be convenient to have a handler that was capable of delegating to other handlers based on a trigger key. That way, SpecialAction could be broken into individual handlers that were each responsible for a single thing. The handler would watch for the trigger key down, then consult its data on subsequent events to figure out which other handler to dispatch to, calling that and modifying the result before returning it.

candera commented 11 years ago

One thing that might help here is to define behaviors with an :id but no :match. Then they could be referenced by name with no danger of being matched by other keys. Or something.