WritingTools icon indicating copy to clipboard operation
WritingTools copied to clipboard

Massive problems with hotkey

Open DavidGP opened this issue 7 months ago • 10 comments

I would so much love to use Writing Tools, however I can't for the life of me set up a hotkey that works.

Strangely, the standard hotkey CTRL+Space did work initially, but now doesn't anymore after a reboot.

No matter what hotkey I set, it only invokes Writing Tools when no text is selected in any source program, like for example in the browser or in Word.

Even more strangely, if I select text in Word and press the hotkey, it deletes the text and replaces it by two copyright characters: ©©

This happens independently of what hotkey I set in Writing Tools. To my knowledge, I have no programs running in the background that interfere with any hotkeys. I tested this by trying to shut down Windows while a dialog box in Word was open. This usually shuts down all background programs except Word. However, the problem remained.

I have tried almost every imaginable (simple or complicated) hotkey combination but none worked, at least not including copying any currently selected text from the source program. Only if nothing is selected, the chat prompt appears -- independent of what hotkey I have set.

I have even tried F13 as a hotkey which is not on my keyboard but which I can send using AutoHotkey. This also works and invokes the "Ask your AI" chat prompt, however only if nothing is selected. As soon as text is selected, for example here in the edit box or in Word or in any other program, nothing happens when I press the hotkey.

The Google Gemini API is set up correctly, since I can chat with Gemini by pressing the hotkey and using the "Ask your AI" chat prompt without problems. Again, this only works when no text was selected beforehand.

Image

DavidGP avatar Jul 09 '25 17:07 DavidGP

Hey David! Thanks so much for your comprehensive report, it really helps. I'm sorry you haven't yet been able to experience Writing Tools.

I've identified 2 core issues you experienced, which I'm working to fix:

  • the fact that ctrl+space initially worked for you means that it's most likely a timing issue that I can easily fix with a new "compatibility mode" option in settings in the next update, coming out this week! I’ve realised that the default timers in the code may not allow things to work on every PC, so this should make things more robust (PS: you saw the copyright symbol because Writing Tools tried to internally emulate a ctrl+c to read selected text, but did it too fast so windows thought you were trying to press alt+c (or something similar) which types that symbol haha).

  • and of course, as you've experienced, the current library used to detect hotkey presses only detects a few precious combos, like “ctrl+space”, “ctrl+`”, “ctrl+j”, etc. I trust you've tried a bunch already and can't get these few backup options to work on your device either. In the longer term, I’m working to significantly improve this too - so we can use whatever keyboard shortcut we set :) I’ll have to try out a bunch of libraries and experiment a bit, so this is not something that'll come out next update.

But yeah, hopefully by the next update, it'll work for you (with ctrl+space).

I’ll ping you on here when I release the next update :D

Cheers!

theJayTea avatar Jul 09 '25 19:07 theJayTea

Hi Jesai,

Thanks for looking into this so quickly. I appreciate the detailed explanation.

Just wanted to confirm that I've already tried a wide range of hotkey combinations, including Alt and Windows key combinations, with or without Ctrl. They all work, however currently exhibit the same behavior as the default hotkeys described in the README: they only trigger Writing Tools when no text is currently selected. When text is selected, nothing happens.

Looking forward to the next update and the "compatibility mode" option! Hopefully, that will resolve the timing issue.

By the way, this is on my work PC, a Lenovo P16 workstation. Last night, I've installed Writing Tools on our kitchen laptop, a Dell XPS model. There everything works perfectly right out of the box. Even my wife was speechless, and that usually doesn't happen.

Thanks again for your INCREDIBLE tool!

PS: Update - Turns out everything is working perfectly now! The issue might have been that I was running Writing Tools from a OneDrive location that may have switched some files to "online-only" during the day. After copying the program folder to my local portable programs folder, everything works flawlessly. Even the program copy on OneDrive works again, probably because everything was downloaded from online-only mode to local mode when copying it to the local folder.

Image

DavidGP avatar Jul 10 '25 08:07 DavidGP

PPS: While the hotkey CTRL+Space seems to work most of the time, I'm now coming across very strange problems, particularly when selecting and editing text in Microsoft Word or Outlook, using Writing Tools.

When I press the hotkey CTRL+Space, ALL of the following things can happen one after the other (not always, but often):

1.) All formatting is removed from the selected text in Word or Outlook.

2.) The DeepL floating quick translation window appears next to the mouse cursor: Image (this normally only appears when pressing DeepL's Hotkey -- see at the bottom of this message)

3.) The DeepL main window appears as well: Image (2. and 3. NEVER appear at the same time natively in DeepL. It's either the one or the other.)

4.) The small version of the writing tools window appears with the prompt "Ask your AI": Image

Just now I even had a case where, after pressing the hotkey for Writing Tools, while it did appear, at the same time it kept writing the following in my Word document (no joke):

16.17.18.19.20.21.22.23.24.25.26.27.28.29.30.31.32.33.34.35.36.37.38.39.40.41.42.43.44.45.46.47.48.49.50.51.52.53.54.55.56.57.58.59.60.61.62.63.64.65.66.67.68.69.70.71.72.73.74.75.76.77.78.79.80.81.82.83.84.85.86.87.88.89.90.91.92.93.94.95.96.97.98.99.100.

So unfortunately, it looks as if there are some terrible things happening in the background when Writing Tools is invoked with its hotkey?

Note that I have changed the standard hotkeys of DeepL (CTRL+CC) in order to not interfere with anything clipboard related: Image

DavidGP avatar Jul 16 '25 11:07 DavidGP

PPS: For a test, I just changed Writing Tools' hotkey to CTRL+F11.

I then placed the text caret in my Word document after the last sentence and pressed CTRL+F11. The following happened:

First, the following was typed into my Word document:

16.17.18.19.20

Second, Writing Tool's small window appeared and typed the following in itself:

L L L L L L L L L

Last, the main window of DeepL appeared with this message: Image

it looks as if there are some terrible things happening in the background when Writing Tools is invoked with its hotkey 🤷‍♂️

DavidGP avatar Jul 16 '25 11:07 DavidGP

PPPS:

The problems are not only due to Writing Tools, but due to some interference with probably the following snippet of an AutoHotkey script that is always running on my PC:

~^c:: ; handle double Ctrl+C because DeepL's own implementation is flawed
{
    ; check for a second Ctrl+C within xxx ms:
    if ( A_PriorHotkey = "~^c" && A_TimeSincePriorHotkey < 333 ) 
	{
        Sleep 111       ; give DeepL a little more time
        Send "+^!L"     ; send actual DeepL Shortcut: Strg+Alt+Shift+L
    }
}

Could it be that Writing Tools sends multiple Ctrl+C shortcuts in fast succession to the system when invoked?

DavidGP avatar Jul 16 '25 11:07 DavidGP

Hi Jesai,

Following up on this, I've done some extensive testing and I believe there are two distinct issues regarding hotkey handling.

1. "Leaky" hotkey registration (Receiving)

The registered global hotkey for Writing Tools is not fully "consumed" by Writing Tools, allowing it to pass through to the active application. For example, Ctrl+Space opens Writing Tools but also triggers the native function of this hotkey in Word/Outlook (e.g., stripping formatting).

  • My current workaround for this is to assign a very complex, globally unused shortcut (like Ctrl+Alt+Shift+M) in Writing Tools' settings. I then use AutoHotkey to intercept my desired Ctrl+Space shortcut and have it send the complex combination instead. This is the only way to effectively isolate the trigger (here, Ctrl+Space) and prevent it from "leaking" through the to the currently active application.

  • Likely Cause (according to Google Gemini 2.5 Pro): This behavior seems to be typical when the RegisterHotKey WinAPI is used without a corresponding low-level keyboard hook (SetWindowsHookEx) to mark the keystroke as handled.

2. Input scrambling with multiple modifier keys (Interference)

This is another issue. When Writing Tools is the active window, it seems unable to correctly process keystroke combinations, at least ones that involve multiple modifier keys (Ctrl/Shift/Alt/Win).

  • Symptom: For example, if a Ctrl+Shift+Alt+Win+K combination is typed when writing tools is in the foreground and the cursor is in its input box, Writing Tools intercepts that hotkey and just types a capital K into its input field. This seems to indicate it only registers the Shift and K keys, while the other modifiers are lost.

  • Likely Cause (according to Google Gemini 2.5 Pro): This could be related to the default KeyDown event handler of the input control itself. Standard GUI framework controls often struggle to correctly parse an event with four simultaneous active modifiers, sometimes defaulting to a simpler interpretation (like only recognizing the Shift state).

In summary, there seems to be an issue with receiving hotkeys without consuming them, and a separate issue with processing complex simulated input when the app itself is active.

Hope this feedback is useful for debugging!

Cheers David

Image

DavidGP avatar Jul 21 '25 10:07 DavidGP

Please, can hotkey handling be fixed? Possibly, the issue is mainly related to clipboard handling. The app either does nothing in many applications (when text is selected), or it replaces the selected text by typing " c" instead of coping it, and then opens the small "Ask Your AI" window. Meaning that it hasn't even received the text that was selected beforehand.

DavidGP avatar Aug 09 '25 11:08 DavidGP

Hey @DavidGP !

I somehow missed this thread of messages that you'd so nicely written out here, so sorry about that.

I'm currently extremely busy with moving to a new country for my undergrad, but this is certainly my top priority for the next update.

As I mentioned, I already have an idea of how to fix this with the compatibility mode (it'll involve disabling the "Ask Your AI" popup, whose detection was causing issues on some PCs; and also making the timers more forgiving)! I appreciate you trying to help with the debugging though.


Responding to your earlier messages:

Could it be that Writing Tools sends multiple Ctrl+C shortcuts in fast succession to the system when invoked?

Yes! Your weird issue with seeing multiple numbers being on screen is most certainly because some AutoHotkey script didn't expect multiple Ctrl+Cs.

Writing Tools internally simulates Ctrl+Cs to do some clipboard juggling magic (this is so that it can work on any textbox, system-wide).

I've never seen that number issue reported at all until now (nor experienced it myself), and it looks like that code snippet was the cause. Now we know haha.


I wish I'd been able to roll out compatibility mode sooner so that everyone gets to enjoy Writing Tools, but sadly my plate has been beyond full - much more than I’d expected - the last few weeks :/

theJayTea avatar Aug 09 '25 21:08 theJayTea

Please, can hotkey handling be fixed? Possibly, the issue is mainly related to clipboard handling. The app either does nothing in many applications (when text is selected), or it replaces the selected text by typing " c" instead of coping it, and then opens the small "Ask Your AI" window. Meaning that it hasn't even received the text that was selected beforehand.

I'm still seeing these problems with the hotkey handling. Very often, it doesn't work at all, as described above.

DavidGP avatar Oct 16 '25 13:10 DavidGP

Hey @DavidGP ! I'm aware.

Life got in the way (highschool final exams, settling into uni in a new country, etc) and I wasn't able to work full time on completing the next update.

After my uni exams and some interview leet code grind this month, I promise I'll add the compatibility mode that should fix your problem :)

I'll ping you on here when that's out!

theJayTea avatar Oct 25 '25 16:10 theJayTea