Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify behaviors by introducing behavior-state-changed event #532

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

okke-formsma
Copy link
Collaborator

@okke-formsma okke-formsma commented Dec 19, 2020

This is a prototype for a behavior-state-changed event, as suggested in #509

  • other events can listen to behavior-state-changed events
  • the behavior-binding functions now can capture the behavior-state-changed event, whereas the current lifetime of *bindings is not guaranteed

Please read this PR commit-by-commit. The last two commits are refactors of hold-taps and sticky-keys which show how this PR creates the ability to easily capture the behavior-state in behaviors.

I will "drip-feed" thse commits in in small pieces as well.

@innovaker
Copy link
Contributor

See #523.

@okke-formsma okke-formsma force-pushed the refactor/behaviors-event branch from 465f281 to 3a2407a Compare January 3, 2021 19:38
@okke-formsma okke-formsma changed the title Introduce behavior-state-changed event Simplify behaviors by introducing behavior-state-changed event Jan 3, 2021
@okke-formsma
Copy link
Collaborator Author

We currently have the following events

  • position_state_changed
    • keycode_state_changed
    • layer_state_changed

What is missing from this event flow are behavior bindings. This means they can not be observed like other events.

  • position_state_changed
    • behavior_state_changed
      • keycode_state_changed
      • layer_state_changed

This PR adds the beahvior_state_changed event which is invoked just before an event is invoked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants