Flycut icon indicating copy to clipboard operation
Flycut copied to clipboard

Fix paste with different keyboard layout

Open voidless opened this issue 4 months ago • 0 comments

Fix for https://github.com/TermiT/Flycut/issues/264 using o3 llm

llm notes:

I traced the problem to the helper method that synthesizes the Cmd-V event after you press the Flycut paste hot-key.

Previously it looked up the key-code for the character “V” through SRKeyCodeTransformer, which depends on the current keyboard layout.

When you copy under one layout and later switch to another, that conversion can return the wrong key-code (often the “A” key-code), so Flycut was unintentionally sending Cmd-A and selecting all text. This ensures the correct key is generated regardless of keyboard layout, eliminating the accidental Cmd-A behaviour.

You can rebuild and test: Copy text under one layout, switch to another, press your Cmd-Shift-V paste hot-key – the item should paste correctly and no longer select all.

voidless avatar Aug 25 '25 16:08 voidless