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

clean up sticky keys loose ends #447

Closed
3 tasks done
okke-formsma opened this issue Nov 29, 2020 · 3 comments
Closed
3 tasks done

clean up sticky keys loose ends #447

okke-formsma opened this issue Nov 29, 2020 · 3 comments
Assignees

Comments

@okke-formsma
Copy link
Collaborator

okke-formsma commented Nov 29, 2020

some small things to fix based on #284

@okke-formsma
Copy link
Collaborator Author

I figured out a better way to verify if next keys pressed should be ignored.

Add an event trace identifier to events. The first event is always a position state changed event. Each time one of those events is created, add a unique version number to it, the event trace id.

Every time a next event is raised from this source event (behaviors should be events too) the event trace id is copied into it.

By doing this it's trivial to filter out events caused by the same source without comparing positions, layers, timestamps or other imperfect identifiers which may not be available everywhere

@okke-formsma
Copy link
Collaborator Author

Sticky keys also make another issue clear; lifetime of behavior pointers and events is not well defined.

Instead we should use a method similar to how events are freed; the event handler returns whether the event is captured or if it should be freed by the event caller.

@okke-formsma
Copy link
Collaborator Author

this can be closed when #506 is merged.

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

No branches or pull requests

1 participant