- Home /
Detect input from EditorApplication.update callback?
I'm trying to create a preferences menu in which I can customize the hotkeys for a few tools I'm developing. Originally I was using the MenuItem attribute, but that solution doesn't really allow for on the fly changes.
Now I'm trying to get input and sort through it for my custom key combinations to trigger my tools. The EditorApplication.update delegate seemed like the perfect place to go, because I assumed I could grab Events from there. Turns out that Events are only generated for GUI callbacks, and Event.current always returns null in EditorApplication.update.
Does anyone know how I can get input from inside the update callback? Otherwise, does anyone know of other solutions to custom key bindings? I know I've seen other people do it in their own assets, but it's all black magic to me at this point.
Thanks!
Answer by SarfaraazAlladin · Sep 30, 2016 at 06:06 AM
For anyone who's interested, I found an answer over here. It's not ideal since it requires reflection, so I think I'll be abandoning this train of thought. Still, it's a solid solution to detecting input from EditorApplication.update