guilryder / clavier-plus

Clavier+ keyboard shortcuts manager for Windows
https://gryder.org/software/clavier-plus/
GNU General Public License v3.0
326 stars 21 forks source link

Clavier+ double sending keys in macro editors or text expanders + counting hotkeys is not working #30

Closed N3C2L closed 2 years ago

N3C2L commented 2 years ago

Hello,

If I merge a new clavier.ini from a fresh Clavier+ installation with my old .ini where all shortcuts are, Clavier+ double sends the keys and counting hotkeys is not working. If I add a new shortcut the counter for hotkeys goes not up. But the bigger problem is, that clavier+ double sends keys. When I use TextExpander tools like PhraseExpress or other macro recorders, macros get double keys, when adding macros. If I close Clavier+ or use fresh .ini it works, but all my shortcuts are gone there. If I delete all the shortcuts from my old .ini it works, so there must be some shortcuts that corrupt my .ini file and sending keys twice? I looked into my shortcuts. There are no shortcuts for normal letters like "s" or "n" , so typing here works normally, but not in text expanders or macro editors. Clavier+ does not send keys twice to text expander or macro editor with fresh .ini from fresh Clavier+ installation. But then again, all my over 100+ shortcuts are not available.

N3C2L commented 2 years ago

I have recognized the problem. If you enter a keyboard shortcut in Clavier+ without ctrl, alt, shift, etc. just the letter, Clavier+ will send the keyboard shortcut twice. So if you only allow a keyboard shortcut like "H" to "S" in the Notepad++ program, it sends the hotkey twice in the TextEpanders or in macro editors. The hotkey will be sent twice even if Notepad++ is not open at all.

N3C2L commented 2 years ago

To reproduce this problem, I recommend PhraseExpress (a text expander): It happens with the auto-complete feature when learning new words. Watch these feature here: https://www.youtube.com/watch?v=srFql6qT0v4

  1. Activate this auto-complete feature in PhraseExpress like shown in the video.
  2. Add a hotkey like "n" makes "s" in Clavier+, and set to run this hotkey only in Notepad++.
  3. Type the same sentence 3 times (to learn this sentence for phrasexpress like shown in the beginning of the video above) anywhere like editor.exe, Firefox or Chrome. Use the letters "n" and "s" in your used words.
  4. Go to PhraseExpress and you will see the words with the wrong double characters in the left pane (a folder in the middle called "AutoComplete")
guilryder commented 2 years ago

If I add a new shortcut the counter for hotkeys goes not up.

I could not reproduce this issue. The "Shortcuts count: X" counter increments each time I add a new shortcut.

clavier+ double sends keys

If I understand correctly, the issue occurs only with shortcuts that have a condition. Clavier+ handles conditions by unconditionally intercepting the keystroke of the shortcut, then simulating the keystroke of the shortcut when the condition does not match. This behavior may interfere with other programs like PhraseExpress that intercept the same keystrokes as Clavier+. I don't think there is a solution other than avoiding to use shortcuts with conditions for keystrokes that PhraseExpress recognizes.

N3C2L commented 2 years ago

I see. I just deleted the 10-20 hotkeys which had no modifier like alt,ctrl etc. and if I use a macro editor, I close Clavier+ before. No problems anymore.