dictation-toolbox / dragonfly

Speech recognition framework allowing powerful Python-based scripting and extension of Dragon NaturallySpeaking (DNS), Windows Speech Recognition (WSR), Kaldi and CMU Pocket Sphinx
GNU Lesser General Public License v3.0
388 stars 75 forks source link

Key printscreen or snapshot without function since 0.31.2 #373

Open tripfish opened 1 year ago

tripfish commented 1 year ago

Hey, since version 0.31.2 the Key action with printscreen or snapshot does not work anymore.

Version 0.31.2:

VK  SC  Type    Up/Dn   Elapsed Key
---------------------------------------------
FF  154 a   d   12.33   ^               
FF  154 a   u   0.00    ^    

Version 0.31.1:

VK  SC  Type    Up/Dn   Elapsed Key
---------------------------------------------
2C  154 a   d   3.97    PrintScreen     
2C  154 a   u   0.00    PrintScreen

Windows 10 64 Bit DPI 15.3

drmfinlay commented 1 year ago

Hello @tripfish,

Thank you for reporting this issue. I can confirm that this key is broken in versions after 0.31.1. It is also broken on the master branch. I should be able to fix this in the next version.

drmfinlay commented 1 year ago

This is now fixed on the master branch. I wrote a program for testing simulated keystrokes from Dragonfly with the AutoHotkey KeybdHook utility and managed to catch another key that doesn't work properly: numlock. I have fixed this one too.

The npsep (VK_SEPARATOR) key might also need to be treated as a "soft" key as per my commit, but I am unable to test it.

tripfish commented 1 year ago

Thanks for the quick bug fix. I have just tested the change. Both keys are working. 👍

What is VK_SEPARATOR? Even if I run it directly as win32api.keybd_event, it has no function on my system.

drmfinlay commented 1 year ago

No worries. Thanks for testing the change.

VK_SEPARATOR is the keycode for the number pad separator key. Hence, Dragonfly's name for it (npsep). According to this SO answer it is available on "Brazilian and some Far East keyboards," but not US keyboards.

I was able to simulate and bind the key to a Windows shortcut. So it does work, it just doesn't produce any output. Autohotkey doesn't know what it is either, which was why I brought it up.