zakarumych / egui-snarl

Customizable egui node-graph library
https://crates.io/crates/egui-snarl
MIT License
287 stars 28 forks source link

How to add user defineded keybindings #19

Open nrot opened 7 months ago

nrot commented 7 months ago

In first attempt i tried to add responses. But problem this is to give user events system. This give complex system, where user add events and events work and clear on next frame. This is create graph response, but i don`t added events system.

So in second attempt i tried to add dynamic trait, but Just not ready for this tricks. This trait have methods that called on render graph and decides events happend. Second attempt

So in third attempt, i just add generic user object for style. Not all ready, some places i forgot edit predefined keybindings. But DefaultGraph Events work. And for examples i tried add Click and move system - not ready yet.

This create some problems:

But have some good news: I think in some places overengineered works with Events and Inputs. In Some place may done easy

You can see current progress

nrot commented 7 months ago

Working demo with click and move for nodes link