-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can I writeText and writeHtml at the same time without triggering the event twice? #28
Comments
I believe this is because the text from step one is not removed from the UI. So it's not a problem with the API.
Not sure if this is what you want. |
When I copy HTML content on Windows, HTML and text will be triggered at the same time, such as copying code in VSCode. I want to be able to write both HTML and text to the clipboard in the same way. This may be a Windows mechanism that allows multiple types of text to exist in the clipboard. |
@Tester-957 I see what you mean. This needs to be added in clipboard-rs. @ChurchTao Here is my experiment with cilpboard-rs, writing html doesn't update text. let ctx = ClipboardContext::new().unwrap();
ctx.set_html("<h1>hello</h1>".to_string()).unwrap();
let txt = ctx.get_text().unwrap();
println!("txt: {:?}", txt);
let html = ctx.get_html().unwrap();
println!("html: {:?}", html); Output:
|
A |
Thank you |
V: 0.6.7 Tested on Windows 11, the problem still exists text is the content I copied last time |
Oh looks like the new api only worked on Mac, but not windows. |
Text has to go before Html, otherwise it won't work on Windows.
Tested on Mac, Win11, and Ubuntu 22. |
I found that when using writeHtml, the html will be written to the clipboard, but the text will not be written. I can understand this. But when the text is copied and writeHtml is used again, the onTextUpdate event will be triggered.
Here are my steps:
Expected results: Step 3 should only listen for hasHTML, not the text from Step 1.🕷️
I think you can add a writeHtmlAndText(html,text) api😉
The text was updated successfully, but these errors were encountered: