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

Cleanup keyboard code #352

Closed drmfinlay closed 3 years ago

drmfinlay commented 3 years ago

This PR cleans up the keyboard code a little and fixes some bugs.

Summary:

LexiconCode commented 3 years ago

Let me know when this is ready to test!

drmfinlay commented 3 years ago

Should be ready to test now. I can already see a problem with Key("") that I'll fix shortly.

~I'd like to merge 326 before this; I anticipate a fair few conflicts.~

LexiconCode commented 3 years ago

In my limited testing this does fix https://github.com/dictation-toolbox/dragonfly/issues/350

Is this PR meant to address the difference in speed between DNS text output versus dragonfly?

drmfinlay commented 3 years ago

Yes. It looks like that problem is caused by incorrect pauses in the Typeable event methods. I think it is still not quite right. It would not have been helped by the bug I fixed with aaff1ba.

LexiconCode commented 3 years ago

Yes. It looks like that problem is caused by incorrect pauses in the Typeable event methods. I think it is still not quite right. It would not have been helped by the bug I fixed with aaff1ba.

We are all human! At least I hope :) Let me know if you can hear a high-pitched squeal from one of my fans going bad as you read this text.

drmfinlay commented 3 years ago

Haha :)

Well, I can confirm that the behaviour doesn't occur for me using the hardware or Unicode events. It is the same speed as DNS if I set pause_default to 0.

Incidentally, I plan to remove the settings.cfg file in the future; the settings are either defunct or better handled by setting class/instance members instead.