pyRevit icon indicating copy to clipboard operation
pyRevit copied to clipboard

Fix: Implement Ctrl+C for selected text in Output Window

Open jmcouffin opened this issue 6 months ago • 2 comments

Fixes #1729.

This commit introduces a PreviewKeyDown event handler in the ScriptConsole to specifically capture Ctrl+C events when the output WebBrowser control has focus. It then uses IHTMLDocument2 to retrieve the currently selected text and copies it to the clipboard.

This proactive implementation aims to ensure Ctrl+C functionality for selected text as requested in the issue, overriding or supplementing the default WebBrowser behavior which was reported as not working reliably for some of you. Manual testing in a Revit environment is recommended to fully confirm the fix across different scenarios.

Related Issues

If applicable, link the issues resolved by this pull request:

  • Resolves #1729

jmcouffin avatar May 28 '25 09:05 jmcouffin

Unable to perform a code review. You have run out of credits 😔 You can buy additional credits from the subscription page.

devloai[bot] avatar May 28 '25 09:05 devloai[bot]

wrong direction, mshtml is net.5 and under

jmcouffin avatar May 30 '25 07:05 jmcouffin