dictation-toolbox / natlink

Natlink provides the interface between Dragon and python
Other
25 stars 17 forks source link

playEvents to be reimplemented via Python for Dragon16 #196

Closed quintijn closed 2 weeks ago

quintijn commented 2 months ago

The playEvents (and also playString) functions, as implemented in C++ with the natlink.pyd file (since 1999!) don't work any more this way. See also issue 176. (https://github.com/dictation-toolbox/natlink/issues/176)

playString is now done via the SendInput module of Vocola (copied into the dtactions repository, (dtactions)\vocola_sendkeys\SendInput.py

Two attempts to implement natlink.playEvents via python failed:

  1. Dane suggested via win32api.PostMessage
  2. Via the above mentioned SendInput module of Vocola (written by Mark Lillibridge).

I think either this module can be adapted for direct playEvents inputs, or the wanted playEvents actions in grammars can be implemented via this module or via the appropriate Dragonfly module.

Hopefully Mark can help here!!

drmfinlay commented 2 months ago

Thanks for opening a new issue on this, Quintijn.

I think PostMessage() will work. My code from the other issue doesn't send the right wParam and lParam values. I had forgotten that playEvents() takes simplified values. If I can get it working, I'll post the code here.

quintijn commented 2 months ago

Dane, you already had win32api.PostMessage in the call.

Maybe you have to include it in a structure, see https://github.com/dictation-toolbox/dtactions/blob/master/src/dtactions/vocola_sendkeys/SendInput.py, around line 50...

LexiconCode commented 2 months ago

It would be good to keep DT separate. I know Doug disagrees with this. However to include a whole library for one function that also complicates install (admin registration of pywin32 when danes function doesn't does not require it) of natlink doesn't seem worth it to me.

My recommendation is to included into both as needed allowing natlink to not use DT as a dependency.

quintijn commented 1 month ago

I support the idea of including python code for playString and playEvents in natlink or in natlinkcore.

I asked Mark Lillibridge to implement playEvents with his SendInput module, which is currently in dtactions and vocola2. Hope to hear from Mark soon!

In the meantime, playEvents with Dragon 16 is not working, but not giving the ESP error and a program stop. This should be released ASAP.

quintijn commented 4 weeks ago

The state is now:

For Dragon 13, 15: playEvents working via C++ code, For Dragon 16: playEvents not working any more. Deprecated.

playString is sent to dtactions repository. Let us keep it like this.

Greetings, Quintijn

quintijn commented 2 weeks ago

close this one, in favour of #200 .