Skip to content

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

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

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from

Conversation

jmcouffin
Copy link
Contributor

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:

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.
@jmcouffin jmcouffin added the New Feature New feature request [class->Implemented #{number}: {title}] label May 28, 2025
Copy link
Contributor

devloai bot commented May 28, 2025

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

@jmcouffin
Copy link
Contributor Author

jmcouffin commented May 30, 2025

wrong direction, mshtml is net.5 and under

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New Feature New feature request [class->Implemented #{number}: {title}]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Copy text from print ouptut to clipboard by Ctrl+C
1 participant