piston icon indicating copy to clipboard operation
piston copied to clipboard

How to push custom events against event loop?

Open po-stulate opened this issue 6 years ago • 3 comments

There is a create_proxy function in glutin seems to be useful, but it is still in alpha and is not supported by both window::Window and window::AdvancedWindow.

Is there any good way to push a custom event for now?

po-stulate avatar Jun 22 '19 02:06 po-stulate

You can create your own custom events here: https://docs.rs/pistoncore-input/0.28.0/input/enum.Event.html#variant.Custom

bvssvni avatar Jun 23 '19 17:06 bvssvni

How do I send it to the event loop? I have multiple threads that raise different custom events at any time, and cannot be refactored to use only main thread. Is there any mechanism like channels or so I can use before the new create_proxy api is supported?

po-stulate avatar Jun 23 '19 20:06 po-stulate

You're right! There is design mistake here. Custom should be moved to Input.

bvssvni avatar Jun 24 '19 11:06 bvssvni

Closing.

bvssvni avatar Apr 30 '24 17:04 bvssvni