-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug with Natlink and Dragon16: natlink.playEvents and other functions #176
Comments
Sorry for your trouble.
|
Thanks for responding! Yes, downgrading to dragonfly 0.35.0 (I mistakenly wrote 0.0.35 above) fixes the issue. Trying with dragonfly 1.0.0rc1 shows the same error as with 1.0.0rc2 Here's the pip output (sorry, I can't figure out how to format it monospaced):
Package Version appdirs 1.4.4 |
Have you tried just a sample grammar/script from dragonfly? Trying to rule out if there's something with strange with a your script that you might have loaded. |
It looks like it's related to the following two lines in one of my scripts:
Using the Mouse class in Dragonfly 1.0.0 with these two lines seems to trigger the error, whereas in Dragonfly 0.35.0 it does not. Not a big loss for me to not use these two lines. Feel free to close the issue if it's not worth digging into further. Thanks for your quick assistance! |
This problem seems specific to DNS 16. I cannot reproduce it with DNS 15 and the same version of Natlink. The new try_natlink Dragonfly feature, enabled by @77capr's code above, utilises Natlink's Do you know if this also occurs with Dragonfly's keyboard actions, @77capr? |
I tried with:
and yes, then invoking dragonfly keyboard actions also trigger the same error |
Thank you, @77capr. I'm not sure if we'll be able to fix the problem. In the meantime, I'll update Dragonfly's documentation to mention this as a potential issue with the try_natlink feature. |
👍 in any case, thanks for all the work on this software! It makes a
difference in my life.
…On Wed, Nov 8, 2023, 06:02 Dane Finlay ***@***.***> wrote:
Thank you, @77capr <https://github.com/77capr>. I'm not sure if we'll be
able to fix the problem. In the meantime, I'll update Dragonfly's
documentation to mention this as a potential issue with the *try_natlink*
feature.
—
Reply to this email directly, view it on GitHub
<#176 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACYBOO265CYYEOWANJU2BW3YDMG7XAVCNFSM6AAAAAA66SYLIOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBRGA4DSOBXGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I only read this now. It seems to boil down to playString (which can easily be avoided) and playEvents, which is probably more hard to tackle. |
This is clearly some sort of interface change in Dragon 16, since I can't reproduce the issue on Dragon 15. I don't think we can fix it. I mentioned some time ago that there should be info in the documentation on what doesn't work in certain versions of Dragon. Perhaps we should revisit that idea? For this issue, a line in natlink.txt could be added:
|
Certainly these functions can be avoided. It is a shame things like this are starting to break, however, since they have been stable for so long. I suppose we should be grateful our COM interface definitions from the late 90's still work at all. I think this issue should remain open, since the problem affects both projects: natlink and natlinkcore. I'll change the title to something more sensible though. |
Avoiding these two functions
We hope natlink will be stable, and does not cause We will try to release the natlink installer ASAP and mention it here. |
Okay then, sounds good. Perhaps I could take a look at writing the playEvents function in Python. I have a pretty good idea of how it works. |
The below function should do essentially what Natlink's playEvents() function does, minus the UI access privilege Dragon gives it. It doesn't work with some windows though. I'm not sure why. import win32api
import win32gui
def playEvents(events):
# Check that *events* is a list.
if not isinstance(events, list):
raise TypeError("events must be a list of 3-tuples")
# Post each 3-tuple event to the foreground window.
hwnd = win32gui.GetForegroundWindow()
for event in events:
if not (isinstance(event, tuple) and len(event) == 3 and
all((isinstance(i, int) for i in event))):
raise TypeError("events must be a list containing 3-tuples of"
" integers")
message, wParam, lParam = event
win32api.PostMessage(hwnd, message, wParam, lParam) |
Hi Dane, others, I tried to implement your code in init.py of https://github.com/dougransom/natlink, branch "fordragon16", with a test routine at the bottom. It gives no mouse movement regrettably. A complete installer on my computer (with Visual Studio Code) did not install correct. So several things to sort out!! |
Hi Quintijn, Thanks for testing my code. Replacing this function is not as simple as I thought it would be. Probably it is better to use the Windows I regret I can't debug the original runtime error myself. I notice some people online mentioning the |
This issue is now closed, in favour of #196 |
Hello,
I was using Natlink 5.5.4 with Dragonfly 0.0.35 for some time without issue. I recently upgraded to Dragonfly 1.0.0-rc2. I then started seeing this error (see also attachment) as soon as I spoke a command involving Dragonfly. I now upgraded to Natlink 5.5.6 without any change in behavior. I'm currently dead in the water with respect to using Natlink/Dragonfly.
Any ideas on how to get around this?
Thanks,
Al
MS Surface Pro 8
Windows 11
DNS 16
Python 3.10.8
The text was updated successfully, but these errors were encountered: