flyover / imgui-js

JavaScript bindings for Dear ImGui using Emscripten and TypeScript
https://flyover.github.io/imgui-js/example/
MIT License
962 stars 103 forks source link

Is it possible to forward or not clipboard events? #65

Open poirierlouis opened 7 months ago

poirierlouis commented 7 months ago

Currently, copy/cut/paste events works as expected within canvas, where ImGui is rendered.

But, this prevent any normal copy/cut/paste events outside the canvas. Is it possible to restore normal clipboard behaviors? Use case would be to use normal clipboard behaviors when canvas is not focused, and forward it to ImGui only when canvas is focused.

Any ideas would be much appreciated.

poirierlouis commented 7 months ago

I found a workaround. Clipboard events are prevented by default in implementation. Removing call to event.preventDefault() is enough to use clipboard in ImGui canvas and outside of it: