Issues: Hotkey and others
-
I appointed Hotkey "Ctrl+` " and after adding the button (the program auto-closing) and the start of the program - hotkey does not work. So that hotkey works again to me - i have to do change Hotkey to any other and then again to "Ctrl+` " that the window would appear when the hotkey press
-
If I do not add a button, then you need the "Apply" button does not close the program for applying changes (It is advisable to make an auto-reload)
-
Sometimes, when highlighting the text and pressing hotkey, a standard window for a question is caused and not a window for working with the text - I still do not understand the logic why this is happening upd: starts working with text again when the hotkey is changed
Hi, what OS are you using? What version of WritingTools? Are you running the binary or the python file?
Hi, what OS are you using? What version of WritingTools? Are you running the binary or the python file?
Windows 10, binary, v7.1 (last version)
- Sometimes, when highlighting the text and pressing hotkey, a standard window for a question is caused and not a window for working with the text - I still do not understand the logic why this is happening upd: starts working with text again when the hotkey is changed
- upd: I found out that when I change the keyboard layout to something other than English, when I select text and press a hotkey, a standart window appears, not a window for working with text.
@needcoder , thank you for your report.
1 and 3: The non-default hotkeys are a bit finicky on some PCs. A thing we have to work around is this: if your keybinding happens to unfocus the selected text in any way, Writing Tools will not be able to "grab"/see it when you invoke it (because it uses ctrl+c internally), causing it to open up in the blank "chat mode" (since it thinks you've selected no text). The key binding may also simply not be detectable by the keyboard input library we're using.
If ctrl+space or ctrl+j doesn't work for you, you'll need a little bit of experimentation to find one that works, unfortunately.
2: Agreed about the restarts, I'm looking to improve it in an upcoming update :)
I've come up with a temporary workaround that works (launches a window specifically for text manipulation when text is highlighted) with any keyboard layout:
- Hokey: "ctrl+`" (or "ctrl+space")
- Microsoft PowerToys -> keyboard manager -> remap a shortcut: "ctrl+`" to "run program" (path with pythonw.exe | argument path with switch_to_english.pyw)
switch_to_english.pyw
import ctypes
def switch_keyboard_layout(layout_id):
hwnd = ctypes.windll.user32.GetForegroundWindow()
thread_id = ctypes.windll.user32.GetWindowThreadProcessId(hwnd, 0)
ctypes.windll.user32.LoadKeyboardLayoutW(layout_id, 0x00000100)
ctypes.windll.user32.PostMessageW(hwnd, 0x0050, 0, int(layout_id, 16))
#Switching to English layout (0x0409 - en-US)
switch_keyboard_layout("00000409")
Hi @needcoder! Thanks for sharing that, sorry I wasn't able to respond earlier.
That's a smart solution for now, and in the future, I'll see if there's something I can do to natively improve this experience for users like you who use multiple keyboard layouts so things just work out of the box :)
I think this is because the hotkeys are not trapped/suppressed by the script. It would be nice to have an option to suppress any hotkey press to avoid having to remap keys or select a different hotkey. This might be more useful as you add the ability to set multiple hotkeys.