Hi! First of all, thank you for this amazing tool. It works great, but I've encountered an issue when using it alongside a clipboard manager.
Context & Environment
- App Version: KeyboardSwitch-4.3.0-x64-win
- OS: Windows 10 22H2
- Primary Clipboard Manager: Clipdiary
The Problem
During the text transformation process, KeyboardSwitch intercepts, modifies, and restores clipboard contents. On my system, Clipdiary captures the original text right at the moment the program interacts with the clipboard.
While I am specifically observing this behavior with Clipdiary, it is highly probable that other similar clipboard managers (like Ditto or CopyQ) might experience the exact same issue.
Security Implications
This behavior is not just a matter of history clutter; it is also a security risk. For instance, if a user decides to fix the layout of a sensitive piece of text (like a password or an API key), the plain-text password gets permanently stored in the third-party clipboard manager's history, exposing sensitive data.
Suggested Technical Solution (AI-Generated Concept)
To prevent clipboard utilities from capturing these internal/temporary operations, the clipboard data could be flagged with specific ignore formats right before committing it to the OS (both during the layout-swapped text injection and the original state restoration steps).
On Windows, this is usually achieved by registering specific clipboard formats and adding them as empty/false entries alongside the main data:
-
For 3rd-party managers (Clipdiary, Ditto, etc.):
Register "Clipboard Viewer Ignore" and set it with IntPtr.Zero.
-
For Native Windows Clipboard History ($Win+V$) & Cloud Clipboard:
Register "CanIncludeInClipboardHistory" and "CanUploadToCloudClipboard", setting their values to DWORD 0 (false) to prevent the built-in Windows buffer from copying the record. Note: I have the native Windows history disabled on my machine, so I am not sure if this is already handled, but adding it explicitly would ensure full coverage.
Concept Example:
uint cfIgnore = RegisterClipboardFormat("Clipboard Viewer Ignore");
uint cfHistory = RegisterClipboardFormat("CanIncludeInClipboardHistory");
uint cfCloud = RegisterClipboardFormat("CanUploadToCloudClipboard");
SetClipboardData(cfIgnore, IntPtr.Zero);
IntPtr hFalse = Marshal.AllocHGlobal(sizeof(int));
Marshal.WriteInt32(hFalse, 0);
SetClipboardData(cfHistory, hFalse);
SetClipboardData(cfCloud, hFalse);
Disclaimer / AI Note
Please note: I am not a programmer, and this entire issue report was generated with the help of an AI (LLM). While the AI correctly captured the essence of my practical problem and user experience, the described technical logic, internal program workflow assumptions, and code snippets might be "slop" or technically inaccurate from the perspective of your actual codebase. Please treat the technical section purely as a conceptual hint.
Thank you for your time and for considering this improvement!
Hi! First of all, thank you for this amazing tool. It works great, but I've encountered an issue when using it alongside a clipboard manager.
Context & Environment
The Problem
During the text transformation process,
KeyboardSwitchintercepts, modifies, and restores clipboard contents. On my system, Clipdiary captures the original text right at the moment the program interacts with the clipboard.While I am specifically observing this behavior with Clipdiary, it is highly probable that other similar clipboard managers (like Ditto or CopyQ) might experience the exact same issue.
Security Implications
This behavior is not just a matter of history clutter; it is also a security risk. For instance, if a user decides to fix the layout of a sensitive piece of text (like a password or an API key), the plain-text password gets permanently stored in the third-party clipboard manager's history, exposing sensitive data.
Suggested Technical Solution (AI-Generated Concept)
To prevent clipboard utilities from capturing these internal/temporary operations, the clipboard data could be flagged with specific ignore formats right before committing it to the OS (both during the layout-swapped text injection and the original state restoration steps).
On Windows, this is usually achieved by registering specific clipboard formats and adding them as empty/false entries alongside the main data:
Register
"Clipboard Viewer Ignore"and set it withIntPtr.Zero.Register
"CanIncludeInClipboardHistory"and"CanUploadToCloudClipboard", setting their values toDWORD 0(false) to prevent the built-in Windows buffer from copying the record. Note: I have the native Windows history disabled on my machine, so I am not sure if this is already handled, but adding it explicitly would ensure full coverage.Concept Example:
Disclaimer / AI Note
Please note: I am not a programmer, and this entire issue report was generated with the help of an AI (LLM). While the AI correctly captured the essence of my practical problem and user experience, the described technical logic, internal program workflow assumptions, and code snippets might be "slop" or technically inaccurate from the perspective of your actual codebase. Please treat the technical section purely as a conceptual hint.
Thank you for your time and for considering this improvement!