WritingTools icon indicating copy to clipboard operation
WritingTools copied to clipboard

Strange character inserted when the app is called (₢)

Open BrunoGeorgevich opened this issue 8 months ago • 5 comments

Specs

OS: Windows 11 24H2 (26100.4061) App Version: 7.1

Issue

Every time I call the app shortcut, a strange character (₢) is inserted in place of the text that is selected. Even if I do not select any text, the character is still being inserted. I don't know if this issue is specific to my PC or if there is an issue with the app. Currently, my shortcut is alt+', but I've already changed it to other shortcuts, and the character insertion persists.

What can i do to solve this issue?

Video

https://github.com/user-attachments/assets/dafe5f4a-52e0-41db-8334-be9784eb78bb

BrunoGeorgevich avatar May 21 '25 12:05 BrunoGeorgevich

It seems when we call the program, you copy the selected text, right? Also, when I hit AltGr + C, the appears. So maybe the shortcut that has been triggered is AltGr + C, then Ctrl + C to copy the selected text content. I've tested with the English (EN-US) keyboard, and the char is not inserted. So maybe the problem is related to my keyboard layout, which is PT-BR (Brazilian Portuguese). What do you think?

BrunoGeorgevich avatar May 21 '25 13:05 BrunoGeorgevich

Apparently, the problem is the function press_ctrl_c() from Windows_and_Linux/WritingToolApp.py. Maybe you should add a sleep before press_ctrl_c() calling the function, and not just after, to guarantee that if the user uses alt as a shortcut, the alt_gr key is not pressed, considering that the alt_gr key is the same thing as pressing ctrl and alt together: alt_gr = ctrl + alt. So, possibly pynput is computing the alt_gr key because I use alt + ' as a shortcut, and the time between when I release the alt and when the ctrl + c simulation is triggered is too short. What do you think?

BrunoGeorgevich avatar May 21 '25 14:05 BrunoGeorgevich

The issue persists in the Arabic layout. Initially, it was believed to affect both English and Arabic layouts; however, further testing revealed that the problem is isolated to non-English layouts. As a temporary workaround, the keyboard layout is being switched to English before using the shortcut. It is suspected that this issue is not specific to Brazilian Portuguese or Arabic, but rather affects all non-English layouts. https://github.com/theJayTea/WritingTools/issues/183

AbdelrhmanElbaz avatar Jun 09 '25 08:06 AbdelrhmanElbaz

Could you please confirm whether the implemented solution has resolved the shortcut functionality issue across various non-English keyboard layouts?

https://github.com/theJayTea/WritingTools/pull/196/commits/598934123459017656eba2d8aede22e0b8af763a

AbdelrhmanElbaz avatar Jun 09 '25 08:06 AbdelrhmanElbaz

Thanks for the debussing and contribution, @BrunoGeorgevich. In 2 weeks from now, I'll be able to start work on Writing Tools again, and I'll take a deeper look at this!

theJayTea avatar Oct 25 '25 15:10 theJayTea