dsnote icon indicating copy to clipboard operation
dsnote copied to clipboard

Start listening, text to active window not working

Open 31337-4554551n opened this issue 1 year ago • 4 comments

When enabling accesibility, use of global keyboard shortcuts, start listening, text to active window doesn't paste the text.

It starts listening, then when it stops the spoken text doesn't appear anywhere.

[edit] If the chosen window is a flatpak app, it works, fine. but not if it's trying to input into a deb installed software

Speechnote 4.4.0 flatpak OS: Pop!_OS 22.04 LTS x86_64 DE: GNOME 42.9 GPU: AMD ATI 76:00.0 Rembrandt GPU: AMD ATI Radeon RX 6700/6700 XT Window system X11

31337-4554551n avatar May 15 '24 14:05 31337-4554551n

Thanks for reporting.

Yes, it's a common problem. From my observation it is not related to flapak/not-flatpak, but rather it just works perfectly for some apps and does not for other. I still didn't figure out what is root cause...

This feature uses "fake" X11 key strokes events to send text to external window. For some reasons, this method doesn't work always.

mkiol avatar May 15 '24 17:05 mkiol

Interesting, because for me it works on every flatpak app, and none of the non flatpak apps. Interesting coincidence if that's not the commonality.

31337-4554551n avatar May 16 '24 06:05 31337-4554551n

I need to make more tests. Maybe this "flatpak" is the right lead...

mkiol avatar May 16 '24 18:05 mkiol

Thank you, I really appreciate all the amazing work you're doing

31337-4554551n avatar May 17 '24 14:05 31337-4554551n

Thank you for developing, this has helped me tremendously!

I'm also running on pop OS 22.4. However, it has also worked on non-Flatpak apps as well, including my Kate text editor and proprietary Chrome browser that I'm writing this message in comma, which is not the flatpak wrapper version.

My testing very informally and very limited seems that it works on most, actually all of the Qt based graphical programs I have, And really, kind of anything else that doesn't involve the Gnome desktop environment. This is very informal, but it It does not appear to be a flatpak vs non flatpak issue for PoP! PS 22.04 at least.

mruderman avatar Oct 23 '24 03:10 mruderman

Thank you for developing Speech Note! I've encountered the same issue, here's my experience on Debian 12 with Xorg 7.7 and Xfce 4.18.

Working:

  • Firefox (apt, GTK)
  • qucs-s (apt, Qt)
  • Zotero (flatpak, GTK)

Not Working:

  • LibreOffice (apt, GTK)
  • Gedit (apt, GTK)
  • Gedit (flatpak, GTK)

At first glance, neither the GUI toolkit nor flatpak seem to be a clear culprit.

Perhaps investigating the keyboard events using xev could provide more insights? You can run xev -id to monitor a specific window, and the ID can be obtained using xwininfo. I'll get back to this when I have more time.

chrstphmr avatar Oct 26 '24 19:10 chrstphmr

@chrstphmr Thanks for sharing the results. I can confirm that I can't run it with LibreOffice and Gedit either :/

So far, I have not found where the problem might be. I would be grateful for any tips if you have found a pattern when it works and when it doesn't.

mkiol avatar Nov 02 '24 14:11 mkiol

No luck with flatpak VS non flatpak? Cos that's the best lead I have. Very consistently works on all flatpak, and none of the debs. It's interesting that you guys are getting a mix

31337-4554551n avatar Nov 02 '24 15:11 31337-4554551n

Same problem here, it works with Firefox and Featherpad, but it doesn’t with Thunderbird, Geany and SublimeText.

2 remarks:

  1. I’m on MxLinux with XFCE. With Thunderbird, Geany and SublimeText, I noticed that when SpeechNote tries to write in the active window, the Workspace icon moves a little bit in the xfce-panel.
  2. If we had an option to add a command after the execution of "Start Listening, text to clipboard", we could put something like "xdotool key ctrl+v" and the problem would be partially solved...

Benilerouge avatar Dec 18 '24 00:12 Benilerouge

Perhaps you could research this repository, which can send text to any application:

[https://github.com/ideasman42/nerd-dictation]

Congratulations on this great tool. It would be perfect if it could solve the problem of sending text to any active window.

lliurexia avatar Dec 22 '24 00:12 lliurexia

@lliurexia Interesting. It looks that nerd-dictation uses external program xdotool to do "key strokes sending". There is also a library libxdo, so it can be easily integrated into SpeechNote.

mkiol avatar Dec 22 '24 13:12 mkiol

Just pushed new beta version to flathub-beta channel. This new beta has an option that allows you to change the method of sending keystrokes to XDO. It is not enabled by default, as I have not tested it extensively so far. This new method seems to work a bit slower, but it also works with gedit and most likely other apps that have had problems receiving "text to active window".

To enable go to Settings->Advanced->X11->Fake keyboard type and set it to XDO.

I would be grateful for your testing and feedback.

image

mkiol avatar Dec 25 '24 08:12 mkiol

Tested... it works perfectly here, thank you so much!

Benilerouge avatar Dec 25 '24 09:12 Benilerouge

it works perfectly here

Cool. Preparing official 4.7.0 release, and this fix will be included as default.

mkiol avatar Dec 28 '24 14:12 mkiol

The new version 4.7.0 is out and available on flathub.

The new version includes "XDO" method as default.

Video presentation of all the new features introduced in version 4.7.0: https://www.youtube.com/watch?v=cEht4Fts6Bo

mkiol avatar Dec 29 '24 14:12 mkiol

The new version 4.7.0 is out and available on flathub.

The new version includes "XDO" method as default.

Video presentation of all the new features introduced in version 4.7.0: https://www.youtube.com/watch?v=cEht4Fts6Bo

Thank you, this looks great. I downloaded the latest release but moving the window while models are downloading (and possibly at other times, barely tested yet) crashes out my entire desktop. Did it once, window kept changing size between 2 sizes (not maximised and regular, but regular and slightly bigger), and I could alt+f4 out. Second time I did it, killed the desktop, mouse moves, but nothing else. Speechnote 4.7.0 flatpak OS: Pop!_OS 22.04 LTS x86_64 DE: GNOME 42.9 GPU: AMD ATI 76:00.0 Rembrandt GPU: AMD ATI Radeon RX 6700/6700 XT Window system X11

31337-4554551n avatar Dec 29 '24 15:12 31337-4554551n