This week we refactored input handling in Zircon which also comes with 2 new features: event bubbling and
event capturing. The model works in a similar way as it works in the browser.
When an event arrives into the system first we find the target
Component, then traverse the path to that component:
this is the capture phase. Any listener can grab the event and say that it handled it, and the propagation stops.
After reaching the target, there is bubbling, which can also be stopped by listeners.
This will make a lot of things possible which were cumbersome to implement so far such as using Mnemonics in menus and key bindings for controls like buttons!
There were also some minor changes:
- #187 The
ToggleButton’s builder ignored
isSelected, so this got fixed.
- #186 There was a small bug in the
TextAreaas well which caused an exception when [Del] was pressed in certain situations.
Caves of Zircon Tutorial
With the new input handling in place we’ll create a release next week for Zircon and we can continue with the tutorial! Keep tuned for the next article soon!
Ever since Caves of Zircon was released people have been perusing the source code and the ECS(ish) lib which we’ve started
working on got picked up by some folks so they asked for some features. So
Entity objects are now modifiable:
you can add/remove
Behaviors as well. We also made the API more abstract which will
enable us to refactor the internals to use Kotlin coroutines later to enable Amethyst to be concurrent / parallel
without the problems which come with excessive thread usage.
Do you have questions? Ask us on our Discord Server.