veeenu / hudhook

A videogame overlay framework written in Rust, supporting DirectX and OpenGL
MIT License
209 stars 30 forks source link

Bug with Clipboard #121

Closed vars1ty closed 1 year ago

vars1ty commented 1 year ago

Currently I've got a multi-line editor built-in into my cheat so that people can write script code using Rune. Although one issue that keeps coming up is the fact that the clipboard is broken. It works for the first few times, then it's unable to:

Is there a workaround for this? Tried if it happens on native Windows with MSVC, and it's the same story there.

veeenu commented 1 year ago

hudhook doesn't directly manage the clipboard, and I'm not confident imgui does either.

According to the imgui crate examples, it looks like there is an implementable trait for clipboard operations that has to be manually set on the context at initialization.

I believe copying and pasting (hehe) the example above should be enough to make things work. If you already have something similar in place, then there may be an actual bug in the implementation of the input management system.

Could you please build a minimum reproducible example against one of the sample hosts (ideally the one your target game uses)?

I have a hunch that the game itself could be trying to interact with the clipboard and thus disrupt the flow of the overlay. If that's the case -- and thus the issue is not reproducible against the sample hosts -- then it might be worth it to implement a super aggressive clipboard manager that tries to repeatedly overwrite the clipboard over the course of a few frames.